---------- Forwarded message ----------
From:
hadi motamedi <motamedi24@gmail.com>Date: Sun, Jul 26, 2009 at 6:11 AM
Subject: Re: Inquiry: How to set the crontab job permanently
To: Suno Ano <
suno.ano@sunoano.org>
Dear Suno
Please find below our logs :
"[root@omc-1 root]# crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.13675 installed on Sun Jul 26 08:36:01 2009)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
30 4 * * * /usr/local/mssBak/script/backup_mss
30 3 * * * /usr/local/mssBak/script/getMCT
08 15 * * * /usr/local/mssBak/script/selectRoaming 899 11
37 08 * * * cp ~www/db_backup/cdr/RoamingCDR* /tmp
[root@omc-1 root]# tail -f /var/log/cron
Jul 26 08:00:00 omc-1 CROND[12552]: (root) CMD (/usr/lib/sa/sa1 1 1)
Jul 26 08:01:00 omc-1 CROND[12588]: (root) CMD (run-parts /etc/cron.hourly)
Jul 26 08:10:00 omc-1 CROND[12847]: (root) CMD (/usr/lib/sa/sa1 1 1)
Jul 26 08:20:00 omc-1 CROND[13134]: (root) CMD (/usr/lib/sa/sa1 1 1)
Jul 26 08:30:00 omc-1 CROND[13510]: (root) CMD (/usr/lib/sa/sa1 1 1)
Jul 26 08:34:10 omc-1 crontab[13643]: (root) LIST (root)
Jul 26 08:35:10 omc-1 crontab[13675]: (root) BEGIN EDIT (root)
Jul 26 08:36:01 omc-1 crontab[13675]: (root) REPLACE (root)
Jul 26 08:36:01 omc-1 crontab[13675]: (root) END EDIT (root)
Jul 26 08:36:06 omc-1 crontab[13710]: (root) LIST (root)
Jul 26 08:37:00 omc-1 crond[982]: (root) RELOAD (cron/root)
Jul 26 08:37:00 omc-1 CROND[13729]: (root) CMD (cp ~www/db_backup/cdr/RoamingCDR* /tmp)
[root@omc-1 root]# ls -la /tmp
total 292
drwxrwxrwt 2 root root 4096 Jul 26 08:37 .
drwxr-xr-x 20 root root 4096 Jul 25 10:02 ..
srwxrwxrwx 1 mysql mysql 0 Jul 25 10:02 mysql.sock
-rw-r--r-- 1 root root 0 Jul 26 08:37 RoamingCDR_2008_08_29
-rw-r--r-- 1 root root 0 Jul 26 08:37 RoamingCDR_2008_08_30
-rw-r--r-- 1 root root 191530 Jul 26 08:37 RoamingCDR_2009_02_04
-rw-r--r-- 1 root root 88043 Jul 26 08:37 RoamingCDR_2009_04_29
[root@omc-1 root]#
"
As you see , the crontab job is functioning correctly but if we try to reboot the server we will loose the last entry listed from the "crontab -l" as above , as we have added it through issuing "crontab -e" . Can you please let us know how we can make it as permanent even after reboot ?
Regards
H.Motamedi
On Sun, Jul 26, 2009 at 5:42 AM, Suno Ano
<suno.ano@sunoano.org> wrote:
Hadi> We have set a new scheduled task through crontab job list , as
Hadi> the followings :
Hadi> #crontab -e
Hadi> 30 23 * * * cp ~www/db_backup/cdr/cdrFromMSC* /tmp
Hadi> It is functioning correctly but we will loose it after server
Hadi> reboot . Can you please let us know how we can set it permanently
Hadi> even after server reboot ? Regards H.Motamedi
If a cronjob is setup correctly it does not vanish after a reboot. I
assume you used crontab -e in order to create/edit the cronjob? What do
your log files tell you? Please do a test and report what you see; take
a look at http://sunoano.name/ws/public_xhtml/time.html#cron --> Testing