Skip to content

Instantly share code, notes, and snippets.

@myabc
Created August 13, 2011 12:31
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 myabc/1143802 to your computer and use it in GitHub Desktop.
Save myabc/1143802 to your computer and use it in GitHub Desktop.
#!/bin/bash
# 1. Save this script somewhere
# 2. Change the following variable, adding the correct path and file extension
# for the files you want to handle.
files="directory/*.extension"
for f in $files; do
echo "Executing commands for file: $f ...";
# 3a. Add Command 1
# b. Add Command 2
# c. Add Command 3
done
# For the next step you may find yourself in a vim editor, which can be confusing. If you'd rather use TextMate for example, run the following before step 4:
# ln -s mate ~/bin/mate_wait
# export VISUAL='mate_wait'
# 4. Then type `crontab -e``and add a line similar to the following.
# 1 2 3 4 5 /path/to/run-scripts.sh
#
# See http://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/
# for an explanation of how to specify the frequency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment