Author Topic: crontab (not working)  (Read 219 times)

Offline gezza

  • Hero Member
  • *****
  • Posts: 513
crontab (not working)
« on: July 01, 2012, 04:48:25 PM »
Hi to all,
I have a user crontab:-
 crontab -l


30 * * * * sh /home/gerald/Documents/rsyncx
---
#! /bin/bash
date > /home/gerald/Documents/working
rsync -aurogp /home/gerald/.kde4/share/ /mnt/lindata/share
date >> /home/gerald/Documents/working
exit 0
---
Which ran for about 1  day then stopped.
This has happened as well since I did a re-install to fix the problem.
I can manually run the backup:-
sh /home/gerald/Documents/rsyncx
and the backup runs as it should.
What has stopped the crontab from working?
Yes it is set to run at boot in PCC
Your thought gratefully received.
Gezza
Also....
It only seems to run (when it does) at *:30 ie every hour at 30 mins past.
Very odd.
G
« Last Edit: July 02, 2012, 12:30:38 AM by gezza »

Offline MBantz

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1317
Re: crontab (not working)
« Reply #1 on: July 02, 2012, 03:56:59 AM »
You could try the suggestion here (crontabfile requires an empty line as the last line):

http://www.linuxquestions.org/questions/linux-newbie-8/crontab-not-working-for-non-root-user-782949/

cheers,
MBantz

Offline kjpetrie

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3985
Re: crontab (not working)
« Reply #2 on: July 02, 2012, 06:23:33 AM »
It runs at *:30 in every hour because that's what you've set. If you want it to run every half-hour, which is what I guess you might mean you have to set that first entry to 0,30 which will then run on the hour and the half hour. The minutes column is the minutes past the hour, not an interval.

As to why it stops after a period of time, there could be several causes. Maybe the cron daemon crashes (unlikely) or is killed by some other process. Maybe the function cannot be completed for some reason. Maybe msec removes your permission to run crontabs from cron.allow. You would need to investigate further.
-----------
KJP
-----------------------------------------------------------
PClos64 RC1 on Intel D945GCLF2 motherboard (Atom 330), 2GB DDR2 RAM, Maxtor STM325031, HL-DT-ST DVDRAM GSA-H42N, Amilo LSL 3220T monitor. Also Acer 5810TG (with custom kernel) and Asus eeePC 2G surf