LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-29-2014, 02:53 PM   #1
wireshark11
LQ Newbie
 
Registered: Nov 2012
Posts: 6

Rep: Reputation: Disabled
Cool How do I create a cron job that will run everyday at 12:20am? and 5:20 AM ?


Currently running Ubuntu 12.04 LTS 64-bit

Any Help Pls
 
Old 01-29-2014, 03:02 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
This will answer your questions related to cron and example configs: http://www.adminschoice.com/crontab-quick-reference/
 
Old 01-29-2014, 03:19 PM   #3
naishal0748
LQ Newbie
 
Registered: Sep 2013
Posts: 5

Rep: Reputation: Disabled
You can type command "crontab -e" in terminal, which will open crontab file in vi editor.

In that file, you can use following line to run your job

1) To run job everyday at 12:20 AM
20 0 * * * "command or script to be executed"

2) To run job everyday at 5:20 AM
20 5 * * * "command or script to be executed"
 
Old 01-29-2014, 03:34 PM   #4
wireshark11
LQ Newbie
 
Registered: Nov 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Cool

The crontab for "everyday at 12:20am and 5:20am

* 12 * * * /usr/bin/wget --spider "http://www.domain.com/cron.php >/dev/null 2>&1

* 5 * * * /usr/bin/wget --spider "http://www.domain.com/cron.php >/dev/null 2>&1

Pls This examples Not Working

Thx
 
Old 01-29-2014, 03:37 PM   #5
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
Please check your syntax against the reference document, your cron job is set to run at 6 AM and 1 PM every day. The hours run 0-23 not 1-24, minutes run 0-59 instead of 1-60 and so on.
 
Old 01-29-2014, 03:51 PM   #6
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US, Earth, end border$! ◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that works well on my cheapest; has been KDE or CLI but open... http://goo.gl/NqgqJx &c ;-)
Posts: 3,553
Blog Entries: 2

Rep: Reputation: 1054Reputation: 1054Reputation: 1054Reputation: 1054Reputation: 1054Reputation: 1054Reputation: 1054Reputation: 1054
Hi. /etc/ has /corn.daily, .hourly, .monthly, and .weekly preset configs to modify and go... best wishes and have fun.
 
Old 01-29-2014, 03:55 PM   #7
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
Quote:
Originally Posted by jamison20000e View Post
Hi. /etc/ has /corn.daily, .hourly, .monthly, and .weekly preset configs to modify and go... best wishes and have fun.
None of these will allow for a special backup time. These run at a preset time they are just blank files.
 
Old 01-29-2014, 05:28 PM   #8
Habitual
LQ Addict
 
Registered: Jan 2011
Posts: 8,343
Blog Entries: 11

Rep: Reputation: 2320Reputation: 2320Reputation: 2320Reputation: 2320Reputation: 2320Reputation: 2320Reputation: 2320Reputation: 2320Reputation: 2320Reputation: 2320Reputation: 2320
anyone that cares, can test their crons at http://www.dataphyx.com/cronsandbox/cronsandboxgui.php
 
1 members found this post helpful.
Old 01-29-2014, 08:08 PM   #9
Tadaen
Member
 
Registered: Sep 2005
Distribution: Arch
Posts: 210

Rep: Reputation: 39
20 0,5 * * * /cron/job/to/run

http://stackoverflow.com/questions/1...pm-for-example

Last edited by Tadaen; 01-29-2014 at 08:10 PM.
 
  


Reply


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
Debian daily cron job won't run, but does run in cron.hourly. sandersch Linux - General 7 05-24-2012 01:50 AM
cron job to create snapshots not working spoovy Solaris / OpenSolaris 4 11-15-2011 04:24 AM
How to create a cron job and run it ,give simpleexample ramakrishnankt Linux - Newbie 18 12-04-2009 07:52 AM
How to create user account with a 'newusers' run from a cron job? tifoso Linux - General 3 11-05-2009 06:19 AM
how to run this cron job ashley75 Linux - General 5 05-24-2004 11:20 AM


All times are GMT -5. The time now is 10:02 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration