On Thu, February 3, 2005 11:04 am, Nick Smith said: > i read up on the man page of rsync and got that this command will backup > my server to another external drive i have: > > mail root # rsync -avz / /mnt/backup/ > > but when i run that command i get a bunch of 'no such file errors' and > then it starts coping everything. is this bad?
[snip] > the root drive is 80gig, and im backing up to an external 160gig drive, > in the event that the 80gig crashes will this be good enough to just > copy the contents back to another drive and have it boot work just like > before the crash? or am i going about this the wrong way? there is no X > on this machine so it will have to be console based. also ive never made > a cron job before, im using vixie-cron, how to i make this command run > every week on sunday at 3am? Correct me if I'm wrong, but shouldn't you also exclude the mountpoint to which you're backing up? I would think that rsync would be able to detect a potential infinite recursion, but I've never tried it myself. Idea here is that you shouldn't include the backup destination in the backup itself, and since you're backing up / and /mnt/backup is part of /, you'd think it would have recursion problems. To make the job run Sundays at 0300, first run `crontab -e` as the user who should run the cron'd command. It sounds like you'd need it to be root if you don't want to get permission errors, but you may want to create a different user to run the cron job, then do fun things with groups in order to get access to the files you need. That, or create a new user who is a member of the root group, edit the crontab, then change the login shell for that user to /dev/null so that they can't log in. Running `crontab -e` will open your favorite editor (as defined by your EDITOR environment variable) in which you can add crontab lines. Their syntax can be found here: http://www.adminschoice.com/docs/crontab.htm I'd also recommend, after you get things running smoothly, using the "quiet" switch to cut rsync's output. That is, unless you want a report e-mailed daily to the user whose crontab contains the rsync command. If this user is really restricted, you might end up seeing a lot of sendmail (or other MTA) errors in your logs. Wouldn't want to bog down your local MTA's queue with a whole nutload of cron reports that can't be delivered! Best of luck, Dave -- [email protected] mailing list
