[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: using cron



On Thursday 21 April 2005 04:08 pm, brandon wrote:
> Hi, suppose i want to run a backup script daily that zips up some of my
> configuration files and place it in my home directory.
>
> I created a file named backup, and put a single line command in it
>
> tar -zcvf /home/brandon/backup.tar.gz2 /etc/fstab /etc/X11/XF86Config-4
> (and other files)
>
> i did a chmod +rwx on it, and placed it in the /etc/cron.daily/ directory.
>
> i tested the script using ./backup and it works as intended
>
> However some days have passed and it hasnt run once yet. what else
> should i do to make it work?

You don't put the script itself in the directory.  Actually, you don't touch 
those directories.  (How would cron know when to run it???) 

You need to create a cron job.  If you're using KDE, you can do this with 
KCron.  There are other utilities to help in creating a cron job.  Try "man 
cron" and "man crontab" for more information.  Basically, to create a cron 
job, you have to tell cron when to run a task and what command to run.  If 
you put this information in a file and run "crontab myfile", it'll read the 
info in that file and create cron jobs accordingly.  The format you need to 
use is available in the cron and crontab man files.

Hal



Reply to: