LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
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 Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:50 AM.

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
Open Source Consulting | Domain Registration