- Newest
- Most votes
- Most comments
RandyTakeshita wrote:
Hi,
Was your original intention to run the command every 1 minute?
If yes, your cron job should look like the following after typing crontab -e:
* * * * * echo foobar >> /tmp/cron-log 2>&1
Arrgh, indeed, thanks!
So this finally works, after I gave up on /etc/crontab and crontab -e, and instead created my own file in /etc/cron.d.
Franck
A bit more info: the instance is using cronie; still no idea why nothing gets executed...
[ec2-user@ip ~]$ sudo yum list installed | grep -i cron
cronie.x86_64 1.4.11-19.amzn2 installed
cronie-anacron.x86_64 1.4.11-19.amzn2 installed
crontabs.noarch 1.11-6.20121102git.amzn2 installed
[ec2-user@ip ~]$ repoquery --list cronie.x86_64
/etc/cron.d
/etc/cron.d/0hourly
/etc/cron.deny
/etc/pam.d/crond
/etc/sysconfig/crond
/usr/bin/crontab
/usr/lib/systemd/system/crond.service
/usr/sbin/crond
/usr/share/doc/cronie-1.4.11
/usr/share/doc/cronie-1.4.11/AUTHORS
/usr/share/doc/cronie-1.4.11/COPYING
/usr/share/doc/cronie-1.4.11/ChangeLog
/usr/share/doc/cronie-1.4.11/INSTALL
/usr/share/doc/cronie-1.4.11/README
/usr/share/man/man1/crontab.1.gz
/usr/share/man/man5/crontab.5.gz
/usr/share/man/man8/cron.8.gz
/usr/share/man/man8/crond.8.gz
/var/spool/cron
It is unclear whether cronie actually uses the /etc/crontab file, so I created a file in /etc/cron.d - still nothing executed :(
[ec2-user@ip cron.d]$ cat influx-update
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
1 * * * * root echo foobar >> /tmp/cron-log 2>&1
Edited by: franck102 on Oct 10, 2019 9:36 PM
Hi,
Was your original intention to run the command every 1 minute?
If yes, your cron job should look like the following after typing crontab -e:
* * * * * echo foobar >> /tmp/cron-log 2>&1
The way you currently have it setup with the "1" in the first position means that the cron job will run once every hour... i.e. 6:01am, 7:01am, 8:01am, etc...
Hope this helps,
-randy
Relevant content
- asked 2 years ago
- asked 2 years ago
- asked 5 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 9 months ago