Re: [SLUG] Need Help Creating a cron job

From: Chris Mathey (slug@mathey.org)
Date: Sun Feb 25 2007 - 08:46:30 EST


Daniel Jarboe wrote:
> > I need to create a cron job that restores a database from a sql file
> > once per day.
> >
> > Can I do this all in one command or do I need to have a cron job
> call a
> > script that then does the work?
> >
>
>
> Either way will work

If you want to add a job to crontab you can edit it directly via crontab
   -e you can view it with crontab -l

I also like to put "MAILTO=<address>" so when they are executed I get an
email (handy for my rsync jobs so I can see the output).

Also,
You should have these folders in /etc :
drwxr-xr-x 2 root root 4096 Jan 15 09:34 cron.daily
-rw------- 1 root root 11 Nov 25 13:58 cron.deny
drwxr-xr-x 2 root root 4096 Nov 25 16:49 cron.hourly
drwxr-xr-x 2 root root 4096 Nov 25 16:49 cron.monthly
drwxr-xr-x 2 root root 4096 Nov 25 16:49 cron.weekly

You can put your script's in there and they will be executed.

-Chris
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 15:35:25 EDT