Permalink
Browse files

updated sync_music script

  • Loading branch information...
1 parent 44f495e commit f176810b5a2458179def3f3cfc976f6df942fca2 @jonmagic committed Jun 13, 2010
Showing with 8 additions and 7 deletions.
  1. +8 −7 script/sync_music
View
@@ -1,10 +1,11 @@
#!/bin/sh
-SERVICE='rsync'
+# add to crontab
+# 0-59/5 * * * * /home/jukeman/apps/jukeman/script/sync_music > /dev/null
-if ps ax | grep -v grep | grep $SERVICE > /dev/null
-then
- echo "$SERVICE service already running"
-else
- echo "$SERVICE is not running, starting rsync"
- rsync -avz -e ssh jukeman@192.168.9.6:apps/jukeman/public/songs /home/jukeman/apps/jukeman/public/
+if [ -z "$(pgrep rsync)" ]
+ then
+ echo "$SERVICE is not running, starting rsync"
+ rsync -avz -e ssh jukeman@192.168.9.6:apps/jukeman/public/songs /home/jukeman/apps/jukeman/public/
+ else
+ echo "$SERVICE service already running"
fi

0 comments on commit f176810

Please sign in to comment.