Re: Cron Job



On 25 Jun 2006, in the Usenet newsgroup comp.os.linux.misc, in article
<1151222477.353385.210200@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, Pankaj wrote:

I've had a look at /bin/backup.. the contents of the file are
/usr/bin/rsync -aqxpor /home/httpd/vhosts/ / backup

Probably shouldn't be in /bin/ as it's not part of Red Hat or Fedora, but
it's not my system.

Is this of any help ?

Does that command do what you want?

In your original post, you wrote:

I am new to Linux and I have to setup a cron job which would take
backup from the server to a tape drive. The job should start whenever
the server is restared.

When you say "server", do you mean the application (probably Apache) or
the computer itself? If you mean the computer itself, put that command
at the end of /etc/rc.d/rc.local (or where-ever rc.local is hiding). If
you mean when the application, put the command at the end of that section
of the script that starts the application - there is likely a 'case'
statement, with the values 'start', 'stop', 'status', 'restart' and
perhaps 'reload'. One probable location would be just before the
double semi-colons that end the 'start' case.

In another post, you write:

what I have understood is that I need a cron job and not an init or
@reboot

The standard 'cron' (vixie-cron) runs jobs at a specific time/date.
There is also a 'anacron' package for systems that are not run 24 hours
a day, and runs jobs that are scheduled by day or day-of-week some set
amount of time after the computer boots. Init or @reboot run jobs when
the computer starts or reboots.

Now, how do I do this ?

If you want cron to run as it does on the other system (backup every
Sunday night at 02:00) then copy the script and cron entry. If you
want the job to run when the computer or application starts, then you
don't want a cron job and must put the backup command either in the
rc.local or application startup script.

Old guy
.



Relevant Pages

  • Re: EWF/DUA help needed
    ... > Your script does not reboot the device because it likely fails on the EXECUTE command. ... I have changed the script file, ... it may not be good implementation of your script for the purpose of changing running app with EWF on. ... > With EWF command you just commit a registry change to move/replace the JP.exe file on next reboot. ...
    (microsoft.public.windowsxp.embedded)
  • Re: Nmon scheduling question
    ... command ran first then in the script is the ps and kill command so it ... Vince this is a great script. ... Cron Job with pid: 135238 Failed ...
    (AIX-L)
  • SUMMARY: cron entry: nth day of every month?
    ... cron can not handle this with its own syntax. ... 21st but "command" only runs if the output of the "date" command ... What I would suggest is rather than embedding the logic in each script ... The answer is it is _not_ possible to control it only with crontab ...
    (Tru64-UNIX-Managers)
  • Script wont run from cron
    ... the command line, but the same script fails when running from cron. ... The /bin/sh script runs, but when it goes to fire up the indexing process, ... set, id and limits. ...
    (freebsd-questions)
  • Re: EWF/DUA help needed
    ... Your script does not reboot the device because it likely fails on the EXECUTE command. ... it may not be good implementation of your script for the purpose of changing running app with EWF on. ... With EWF command you just commit a registry change to move/replace the JP.exe file on next reboot. ...
    (microsoft.public.windowsxp.embedded)