LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 04-01-2011, 08:58 AM   #1
hen770
Member
 
Registered: Oct 2010
Distribution: Arch
Posts: 136

Rep: Reputation: 7
Angry is my crontab crazy ?!


see what i mean by the title.
when i put the following code in my cronjob via the command cronjob -e (from my user), it get it and everything works great.
Code:
SHELL=/bin/bash
MAILTO=hanan
16 15 * * * /bin/mount /dev/sdb2 && /usr/bin/rsync -r -t -v --progress --delete --size-only /home/hanan/Programs /home/hanan/Backup/Programs && /bin/umount /dev/sdb2
the thing to point your eye on is the time.
and when i am trying to put another time in it like that:
Code:
SHELL=/bin/bash
MAILTO=hanan
16 57 * * * /bin/mount /dev/sdb2 && /usr/bin/rsync -r -t -v --progress --delete --size-only /home/hanan/Programs /home/hanan/Backup/Programs && /bin/umount /dev/sdb2
it won't let me to save that, and give me the following error:
Code:
crontab: installing new crontab
"/tmp/crontab.cxyC4J/crontab":2: bad hour
errors in crontab file, can't install.
Do you want to retry the same edit? (y/n)
what do you think ha ?

Thanks.
 
Old 04-01-2011, 09:00 AM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,276
Blog Entries: 1

Rep: Reputation: 1057Reputation: 1057Reputation: 1057Reputation: 1057Reputation: 1057Reputation: 1057Reputation: 1057Reputation: 1057
Because there are only 24 hours in a day. 57 is out of range.
 
Old 04-01-2011, 09:00 AM   #3
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,647

Rep: Reputation: 524Reputation: 524Reputation: 524Reputation: 524Reputation: 524Reputation: 524
No, crontab is correct. Hour 57 doesn't exist. The format is

Code:
# minute hour  day-of-month month day-of-week   command
If you want the job to fire at 4:57 PM, you need: 57 16 * * * /bin/mount/etc
 
Old 04-01-2011, 09:27 AM   #4
hen770
Member
 
Registered: Oct 2010
Distribution: Arch
Posts: 136

Original Poster
Rep: Reputation: 7
well, thank you guys, i have totally forgot about that, the first one is the minutes .

Thanks.
 
  


Reply

Tags
crontab, time


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
replaced crontab, now should get crontab back to what it was raminn Linux - Newbie 2 10-20-2008 07:15 PM
Going crazy with crazy contact lenses puffaddering Linux - Certification 1 07-29-2007 08:42 PM
system-wide crontab in /etc/crontab ner Linux - General 2 11-18-2003 12:35 PM


All times are GMT -5. The time now is 12:23 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration