LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   using crontab (https://www.linuxquestions.org/questions/linux-newbie-8/using-crontab-317466/)

goodolday 04-26-2005 05:56 PM

using crontab
 
this is a practice ques in my linux book, very new to linux, looking for some help with this ques, it says to create a backup schedule as follows:

Set up a complete tape drive backup of the whole system to run every 1st and 15th day of every month at 11pm

Set up a tape drive backup of the /project directory and all its contents to run every weekday (Mon through Fri) at 8pm

The ques says to use crontab, i read over everything and i'm still confused,

thanks,

jschiwal 04-26-2005 07:16 PM

I assume that you meant to say 'question'.

There are three parts to the problem.
1) A script that will perform the backup of the system
2) A script that will perform the /project directory backup
3) Setting up the cron entries to execute these tasks when you want.

The crond daemon is what performs the execution as certain times using tables on /var/cron/tabs. However, these tables aren't changed directly. You use the 'crontab' program to do this.

Something else to consider is whether on your system, regular users are allowed to use crontab. If this is your system you could change the policies to allow this. However, your example sounds like you need to perform system tasks as the root user.

You may want to print out the man (5) crontab man-page.

man 5 -Tps crontab >crontab.ps
kghostview crontab.ps

for example will give you a better looking man page that you could print out.

Also, it may be a good idea to pipe the output of the crontab listing to a file. Then you can first backup this file and then use any text editor to make changes. When finished, use crontab to load in the new cron table in toto.


All times are GMT -5. The time now is 07:33 PM.