Skip to content

Instantly share code, notes, and snippets.

@saxbophone
Created April 30, 2015 13:36
Show Gist options
  • Select an option

  • Save saxbophone/08e7bae2a13f879fac6c to your computer and use it in GitHub Desktop.

Select an option

Save saxbophone/08e7bae2a13f879fac6c to your computer and use it in GitHub Desktop.
Recursive shell script using Unix at daemon
#!/bin/bash
# A recursively self-calling shell script, using Unix at daemon
# for scheduling future runs of itself.
# ...
# Put whatever you want your script to do here
# ...
# This bit will schedule this file to run again
FILE_NAME="self.sh"
SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/$FILE_NAME"
RUN_TIME="00:00"
echo "bash $SCRIPT_PATH" | at $RUN_TIME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment