Last active
December 30, 2019 14:37
-
-
Save nehabhardwaj01/e991a76b73d640243c3914d480686fa3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Start the run once job. | |
echo "Docker container has been started" | |
# Setup a cron schedule | |
echo "* * * * * /run.sh >> /var/log/cron.log 2>&1 | |
# This extra line makes it a valid cron" > scheduler.txt | |
crontab scheduler.txt | |
cron -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@peter279k Yes, it can be rewritten in a single line as you suggested. The only difference is the former one serves better clarity.