Hi all,
I'm trying to execute a command once a minute. As a test I place this:
0,1 * * * * /bin/ping -c1 w.x.y.z > /dev/null 2>&1
in /etc/cron.d/everyMinute
but nothing is happening. I've done "service crond restart".
Any ideas?
Thx, Mike Wright
On Thu, Dec 12, 2013 at 3:31 PM, Mike Wright mike.wright@mailinator.com wrote:
Hi all,
I'm trying to execute a command once a minute. As a test I place this:
0,1 * * * * /bin/ping -c1 w.x.y.z > /dev/null 2>&1
in /etc/cron.d/everyMinute
but nothing is happening. I've done "service crond restart".
Any ideas?
That "0,1" tells cron to run your command at N:00 and N:01 every hour. You want "0-59" instead.
-T.C.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 12/13/2013 09:02 AM, T.C. Hollingsworth wrote:
On Thu, Dec 12, 2013 at 3:31 PM, Mike Wright mike.wright@mailinator.com wrote:
Hi all,
I'm trying to execute a command once a minute. As a test I place this:
0,1 * * * * /bin/ping -c1 w.x.y.z > /dev/null 2>&1
in /etc/cron.d/everyMinute
but nothing is happening. I've done "service crond restart".
Any ideas?
That "0,1" tells cron to run your command at N:00 and N:01 every hour. You want "0-59" instead.
or */1
e.g.
*/1 * * * * /bin/ping -c1 w.x.y.z > /dev/null 2>&1
All the best,
- -Greg
-T.C.
- -- +---------------------------------------------------------------------+
Please also check the log file at "/dev/null" for additional information. (from /var/log/Xorg.setup.log)
| Greg Hosler ghosler@redhat.com | +---------------------------------------------------------------------+
Gregory Hosler wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 12/13/2013 09:02 AM, T.C. Hollingsworth wrote:
On Thu, Dec 12, 2013 at 3:31 PM, Mike Wright mike.wright@mailinator.com wrote:
Hi all,
I'm trying to execute a command once a minute. As a test I place this:
0,1 * * * * /bin/ping -c1 w.x.y.z > /dev/null 2>&1
in /etc/cron.d/everyMinute
but nothing is happening. I've done "service crond restart".
Any ideas?
That "0,1" tells cron to run your command at N:00 and N:01 every hour. You want "0-59" instead.
or */1
e.g.
*/1 * * * * /bin/ping -c1 w.x.y.z > /dev/null 2>&1
All the best,
Don't think that does what you want, */5 is every 5th time, but /1 is a NOP, I think. All asterisks should be once a minute.
- -Greg
-T.C.
+---------------------------------------------------------------------+
Please also check the log file at "/dev/null" for additional information. (from /var/log/Xorg.setup.log)
| Greg Hosler ghosler@redhat.com | +---------------------------------------------------------------------+ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlKqYJkACgkQ404fl/0CV/RyVACgzzsXcWfi3efH9pd7kdj+G/Mq jOsAoLGutetMqZDlP6jH4qLbHkQVVMmX =fSMA -----END PGP SIGNATURE-----
On 12/12/2013 09:10 PM, Bill Davidsen wrote:
Gregory Hosler wrote:
On 12/13/2013 09:02 AM, T.C. Hollingsworth wrote:
On Thu, Dec 12, 2013 at 3:31 PM, Mike Wright mike.wright@mailinator.com wrote:
Hi all,
I'm trying to execute a command once a minute. As a test I place this:
0,1 * * * * /bin/ping -c1 w.x.y.z > /dev/null 2>&1
in /etc/cron.d/everyMinute
but nothing is happening. I've done "service crond restart".
Any ideas?
That "0,1" tells cron to run your command at N:00 and N:01 every hour. You want "0-59" instead.
or */1
e.g.
*/1 * * * * /bin/ping -c1 w.x.y.z > /dev/null 2>&1
All the best,
Don't think that does what you want, */5 is every 5th time, but /1 is a NOP, I think. All asterisks should be once a minute.
* * * * * command to execute | | | | | | | | | | | | | | | | | | | +--- day of week (0 - 7) 0 to 6 are Sunday to Saturday, | | | | or use names; 7 is Sunday, the same as 0 | | | +----- month (1 - 12) | | +------- day of month (1 - 31) | +--------- hour (0 - 23) +----------- min (0 - 59)
therefore;
1 * * * *
should be use.
using a </> key is to indicate skip period as in;
*/2
would be every 2 hours.
i do not know what op's
0,1
would do as i have never seen <,> used in any cron commands.
hello again mike,
On 12/12/2013 10:35 PM, g wrote: <>
i do not know what op's
0,1
would do as i have never seen <,> used in any cron commands.
now i do. and when i found it, it did come back to me, in spite of my 'chemo brain'. ;=)
while watching reruns of 'space 1999', during a commercial, the use of <,> key hit me and i did recall it from a very long time ago, so i decided to run a search.
which was;
https://ixquick.com/do/search?q=%22cron%22+tutorial&lui=english About 307,925 results
i found;
=+=+=+= http://www.tldp.org/LDP/GNU-Linux-Tools-Summary/html/scheduling.html
=+=+=+= http://www.scrounge.org/linux/cron.html
0,15,30,45 * * * * /usr/bin/foo
Will run /usr/bin/foo every 15 minutes on every hour, day-of-month, month, and day-of-week. In other words, it will run every 15 minutes for as long as the machine it running.
=+=+=+= http://clickmojo.com/code/cron-tutorial.html
How do I run a task every 5 minutes?
One option is to use
MAILTO=cron@username.plus.com 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /command/to/execute
However, there is a special shortcut for this: MAILTO=cron@username.plus.com */5 * * * * /command/to/execute
The */5 is known as a short form equivalent to 0,5,10,15,20 etc... and achieves the same effect as the previous example, executing the command every 5 minutes. Other examples are: */2 would be every 2 mins, */30 every 30 minutes and so on. You can use the same short form for the hour indicator */2 every 2 hours, */6 every 6 hours etc.
=+=+=+= http://www.unixsurgeon.com/kb/cron-job-tutorial.html
If you want the cron job to run at 1:00 and 2:00 A.M:
* 1,2 * * * /home/username/public_html/mail.sh
This runs your cron at 1A.M and 2A.M every day, every month and every week.
=+=+=+=
i hope that helps you more with your cron.
later.
On 12/12/2013 08:35 PM, g issued this missive:
On 12/12/2013 09:10 PM, Bill Davidsen wrote:
Gregory Hosler wrote:
On 12/13/2013 09:02 AM, T.C. Hollingsworth wrote:
On Thu, Dec 12, 2013 at 3:31 PM, Mike Wright mike.wright@mailinator.com wrote:
Hi all,
I'm trying to execute a command once a minute. As a test I place this:
0,1 * * * * /bin/ping -c1 w.x.y.z > /dev/null 2>&1
in /etc/cron.d/everyMinute
but nothing is happening. I've done "service crond restart".
Any ideas?
That "0,1" tells cron to run your command at N:00 and N:01 every hour. You want "0-59" instead.
or */1
e.g.
*/1 * * * * /bin/ping -c1 w.x.y.z > /dev/null 2>&1
All the best,
Don't think that does what you want, */5 is every 5th time, but /1 is a NOP, I think. All asterisks should be once a minute.
- command to execute
| | | | | | | | | | | | | | | | | | | +--- day of week (0 - 7) 0 to 6 are Sunday to Saturday, | | | | or use names; 7 is Sunday, the same as 0 | | | +----- month (1 - 12) | | +------- day of month (1 - 31) | +--------- hour (0 - 23) +----------- min (0 - 59)
therefore;
1 * * * *
should be use.
No. An asterisk in ANY field means "run for every unit this field represents" and a "*/1" would be redundant (it may even be ignored).
A "*" in the first (minute) field means "run every minute". A "1" in that field means "run on the first minute ONLY" (e.g. 12:01, 1:01, 2:01 and so on, but NOT 12:02 or 1:02). A "0" in that field would run at 12:00, 1:00, etc. Get it? ---------------------------------------------------------------------- - Rick Stevens, Systems Engineer, AllDigital ricks@alldigital.com - - AIM/Skype: therps2 ICQ: 22643734 Yahoo: origrps2 - - - - Is that a buffer overflow or are you just happy to see me? - ----------------------------------------------------------------------