Created
August 13, 2011 12:31
-
-
Save myabc/1143802 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# 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