Some time ago I reviewed iBackup, though I cant seem to find the review on MacMod anymore. At any rate its a simple free utility that does exactly what you are asking. You schedual times and what you want to back up for each client and iBackup does its thing. It mounts the desired volume, performs the backup and unmounts when its finished.
I'm just looking to back up the home folders for each user on the network a total of 5 computers plus the server it's self. i don't need to use carbon copy cloner, since i don't require a bootable drive. though at some point that might be a good idea.
like i said in my first post. i would like this to be completely automated. the server starts up at a certain time of the night. wakes Each computer then mounts the appropriate drive or folder. Copies the contents of the specific drives/shared folders to a specific place on one drive or a designated drive. After the back up of each machine is completed they should be put back to sleep.
yep not much......
2.4gHz 15" MacBook Pro, 1.66gHz Core Duo Mac Mini, 2.5gHz G5 QUAD, 733mHz Quicksilver, 450mHz G4 Cube, 700mHz G3 iBook, 350mHz Sawtooth G4, 350mHz Revs. A and B B&W G3, 16mHz Powerbook 100, 8mHz Macitosh Classic.
You might be able to do everything from the server.
You can wake the server at scheduled times easily enough from the sys prefs. You can schedule a script to run using cron. This script would need to contain lines to accomplish the following:
01 Wake the first client machine; 02 Mount the shared volume; 03 Copy the user folder to the server; 04 Sleep the client; 05 Repeat the first 4 for the other clients; 06 Sleep the server;
Lets address these one at a time (If I could write the script for you on the fly I would, but my scripting isn't that hot).
01 You could wake the client machines using sys prefs too, but you would need all machines to be consulting a network time server and/or some variation in waking times to allow for services and things to startup and you are going to end up with machines waiting for each other to finish backing up unless you do them all at once and either way, you are wasting electricity. Better to use magic packets to wake the clients. I use an app called Wake Up! to do this from the Finder, not sure if it is scriptable or not but I would be very surprised if there is not a command line tool which can do this part for you. Should be able to put them to sleep again too.
02 It should be easy enough to mount the client. I imagine the Mount command will do it for you, you'll have to look up the exact syntax.
03 Copying is easy enough. the copy command in terminal is cp.
04 As mentioned, your magic packet tool should sort this part out for you.
05 You could try and be fancy and use some kind of loop, but since you only have 5 machines, you may as well make good use of copy and paste and just change the names of the clients and user folders as needed.
06 I imagine there is a simple command to do this, but I don't know what it is. I know there is one for shutting down.
I mentioned that some services will need time to start up. If you wake a client and immediately try to mount it over afp, you are risking timeouts. You can make the script pause using the sleep command. (Syntax is "sleep n" where 'n' is the number of seconds).
Doing things this way will require the clients to run AFP of course, and to sleep at all times instead of shutting down, but to be honest only the RAM is powered during sleep and that runs on 2 or 3 V, so its not so bad.
The only problem I can see doing things this way, is that when you copy a user folder from a client over AFP, you tend to get permissions issues. That should be the trickiest bit.
macosxhints and the o'reilly website are good sources for learning about terminal commands. If you know the name of a command you can read its instructions using the 'man' command. ("man command") where command is any terminal command will display the manual pages. If youa re looking for a command, you can search for keywords using the 'apropos' command, followed by a keyword to look for. This will show a list of commands which are relevant to that keyword.
You will find there are good scripters on the Apple Discussions boards if you want someone knowledgable to ask about things.
#468821 - 10/19/0608:14 PMRe: auto-mount network drives and back up
use "ditto" instead of "cp" for your command if you are going to use the shell for scripting. Ditto takes all the fie forks so the files are actually usable when they are copied.
I'm not sure how you could tell a machine to "wake" unless you use the "wake for ethernet network administrator access". I imagine that is based on the Remote Desktop port for the waking. Hey here's an idea, I'd say it may be easier than anything else. All times are fictitious, but you'll get the idea. If you server goes to sleep, stop doing that. (Don't forget that your computer runs performance cron jobs while you are sleeping on a daily, weekly and monthly basis). Then use this idea...
At 0300 have each machine make a disk image of the user's home folder. Compress it. Send it to the server, with the IP or user's name (if they are unique). This would allow for all computers to be backing up at the same time and writing to the server at the same time. I believe this is a reverse answer to your problem, but appears to be one that could be scaled to any number of machines....
I'll try making a script for it, if I am successful, I will post it.
#468822 - 10/19/0608:44 PMRe: auto-mount network drives and back up
So the auto-mount is fairly easy. I'll let you figure that one out, it will be worth your time to figure it out and learn a little bit about applescript. Here's a proof of concept script to show you that you can compress a folder to a zip file... you could expand this to do a tar or some other form of compression, or do multiple folders to the same zip....
put this in script editor or copy the unix command to the terminal to test for yourself. good luck, let me know if you need any help.
-- pick a file to zip (in your case you could just set POSIXFolder to "~/" if the user you want to backup is logged in or "/Users/" if you want to get them all. But beware, some apps store some big files in the user library folders! set FinderFolder to choose folder
-- this step is to make the finder file you just selected into a POSIX (unix) path. set POSIXFolder to (POSIX path of FinderFolder)
-- here's the chicken and stuffing of the script. First move to the directory to create the zip file in, then do a ditto to crate the file. I named it Test.zip, but you could name it whatever you want (a different name for each script, or append this script to make that a variable of your choosing set ArchiveScript to ("cd ~/ ; ditto -c -k -X --rsrc " & POSIXFolder & " Test.zip ")
-- And do the script. This is just how I like to write scripts. Define the script, then a separate command to run it. I don't know how much more memory or time I am wasting doing it this way, but it makes it alot easier if you are going to be test multiple script values. At least I think so. do shell script ArchiveScript
Xplain's use of MacNews, AppleCentral and AppleExpo are not affiliated with Apple, Inc. MacTech is a registered trademark of Xplain Corporation. AppleCentral, MacNews, Xplain, "The journal of Apple technology", Apple Expo, Explain It, MacDev, MacDev-1, THINK Reference, NetProfessional, MacTech Central, MacTech Domains, MacForge, and the MacTutorMan are trademarks or service marks of Xplain Corp. Sprocket is a registered trademark of eSprocket Corp. Other trademarks and copyrights appearing in this printing or software remain the property of their respective holders.
All contents are Copyright 1984-2010 by Xplain Corporation. All rights reserved. Theme designed by Icreon.