Creating a Cron File
Hey everyone, I was hoping someone can help me create a Cron file. I've tried reading through my Linux book but I am just lost here. I need to create a Cron file that will perform a Level 0 backup once per month, a Level 2 dump one day per week, and a Level 5 dump every day that neither a level 0 nor a level 2 dump is performed. Thanks for any help, it is greatly appreciated.
|
Quote:
Read the man pages on crontab, and Google has lots of different reference guides that do a great job explaining cron, like this one: http://www.thegeekstuff.com/2009/06/...ntab-examples/ So, whatever program you're using to do your backups, write a shell script (if needed), that does what you want for each 'level'. Then schedule them with cron. Your details are vague...you say "once per month", "one day per week". When is "once a month"?? First of the month? 10th? 21st? Same for one day per week...scheduling details are going to be different for all of that criteria. And your 'level 5' dump can just be scheduled for all the other days of the week. |
I like this page for cron reference http://en.wikipedia.org/wiki/Cron as it gives a lot of specific examples.
For your question, should the Level 2 only be performed on days there was not a Level 0? And does it matter if the Level 2's are not exactly one week apart (e.g., must they always be run on Sundays)? In either case, you could maybe do something like: 1. Run the level 0 on the first Sunday of every month 2. Run the level 2 on every Sunday (or Sundays 2-5 of every month if they're not supposed to run on the same day) 3. Run the level 5 M-Sat |
Hi,
First of all: you already have a cron file, it's builtin in Linux when you install it... The file is just empty. To open the cron file, and execute a command as root, type Code:
sudo crontab -e Code:
0 0 1 * * dump -0u -f [destination path] [directory to backup] And for the level 2 dump once a week Code:
0 0 * * 0 dump -2u -f [destination path] [directory to backup] |
Quote:
And Linux has a command named dumb. ---------- Post added 08-17-11 at 06:09 PM ---------- Quote:
|
All times are GMT -5. The time now is 06:18 PM. |