Skip to content

Instantly share code, notes, and snippets.

@nehabhardwaj01
Created June 21, 2019 06:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nehabhardwaj01/e6694a1efc6efe7ddf1309184f91dba9 to your computer and use it in GitHub Desktop.
Save nehabhardwaj01/e6694a1efc6efe7ddf1309184f91dba9 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Start the run once job.
echo "Docker container has been started"
declare -p | grep -Ev 'BASHOPTS|BASH_VERSINFO|EUID|PPID|SHELLOPTS|UID' > /container.env
# Setup a cron schedule
echo "SHELL=/bin/bash
BASH_ENV=/container.env
* * * * * /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