Skip to content

Instantly share code, notes, and snippets.

@sakadon
Last active December 14, 2015 13:11
Show Gist options
  • Save sakadon/68e7118eb2419d945da1 to your computer and use it in GitHub Desktop.
Save sakadon/68e7118eb2419d945da1 to your computer and use it in GitHub Desktop.
指定されたディレクトリ内部でgit pullするのをディレクトリ分、繰り返すshell script ref: http://qiita.com/sakadon/items/3aded92edc5867dbb0a5
#!/bin/bash
set -eu
nowdate=`date "+%Y/%m/%d %T"`
host=`hostname -f`
echo -e '!!start git pull carnival!!' | ./slack.sh
find /var/www/html -mindepth 1 -maxdepth 1 -type d | while read FILE
do
echo '----------'
echo 'find: '${FILE}
cd ${FILE}
pwdmsg=$(pwd)
gitmsg=$(git pull)
slackpost=${pwdmsg}'\n'${gitmsg}
echo -e ${slackpost} | ./slack.sh
done
echo -e '!!done git pull carnival!!' | ./slack.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment