I want to create a cronjob inside alpine image, which will run every 15 seconds. The command in dockerfile for this is
RUN echo "*/15 * * * * * /etc/init.d/aws-env-setup.sh" >> /var/spool/cron/crontabs/root
Below is the file after image start.
# do daily/weekly/monthly maintenance
# min hour day month weekday command
*/15 * * * * run-parts /etc/periodic/15min
0 * * * * run-parts /etc/periodic/hourly
0 2 * * * run-parts /etc/periodic/daily
0 3 * * 6 run-parts /etc/periodic/weekly
0 5 1 * * run-parts /etc/periodic/monthly
*/15 * * * * * /etc/init.d/aws-env-setup.sh
The cronjob is not running.
How can I successfully create cronjob inside alpine containers. My aim is to run the cronjob only once, 15 seconds after container starts .
Last line of my sh file, I want to run under cron is -
crontab -r