cron

Updated: 22 August 2024

Maintain crontab files for individual users.

Edit the current crontab. After exiting the editor, the modified crontab will be installed automatically.

crontab -e

Display the current crontab on standard output

crontab -l

Display the crontab of a particular user

sudo crontab -u ec2-user -l

Start a Docker project when host system is rebooted

@reboot sleep 60 && \
touch /home/chris/docker-project/reboot.log && \
echo "$(date): System rebooted, attempting to start." >> /home/chris/docker-project/reboot.log && \
cd /home/chris/docker-project && \
docker compose up -d

Save output to file

*   *   *   *   *   /home/chris/purge.sh > /bin/purge.log 2>&1

Leave a comment