Operating Systems > Linux and UNIX

Backup

<< < (2/3) > >>

TheQuirk:
If I let it run using the root crontab, it'll have root priviliges, right?

so. . .

0 2 * * * /etc/cron.daily.backup.cron > /root/logs/backup.log 2>&1

Would work perfectly? I just need crude backup of the /home directory!

voidmain:
It will run under root in both root's crontab and in cron.daily, no difference other than you can't specify a time apart from the other cron.daily tasks. Do the directories exist that are defined at the top of the script?  Did you try and run the script on the command line?

The first thing that is wrong is there is a "fi" missing at the very end. You need to make sure the directories exist that are defined at the top of the script. And in your case you need to make sure the "$TIMEDIR/gleb-full-date" file exists. If it does not create it by:

# echo "09-Nov" > /backups/last-full/gleb-full-date

Make sure the "/home2/backup" and "/backups/last-full" directories exist. If you don't want the stuff going to those directories just change the variables at the top of the script. It runs fine on my machine after doing the above.

[ December 10, 2002: Message edited by: void main ]

TheQuirk:
Aha, I did it, and it worked! Thank Void! This should definetly go into the FAQ!

voidmain:
No problem. I wouldn't put the script in /etc BTW. Put it somewhere else... but that just may be more of a personal preference.

TheQuirk:

quote:Originally posted by void main:
No problem. I wouldn't put the script in /etc BTW. Put it somewhere else... but that just may be more of a personal preference.
--- End quote ---


Where would you stick it? I got the hand of cron (such a simple concept, I should've read about it a year ago. It would've made life SO much easier!)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version