Parcourir la Source

~/.rsync-backup.sh: Exit if another rsync is already running.

Lucas Stadler 13 ans auparavant
Parent
commit
f53a291dee
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 6 0
      .rsync-backup.sh

+ 6 - 0
.rsync-backup.sh

@ -2,6 +2,12 @@
2 2
3 3
# rsync's $HOME to my local backup server.
4 4
5
# Exit if already running
6
if `pidof rsync &> /dev/null`; then
7
	echo "Looks like another rsync is already running, exiting..."
8
	exit 0
9
fi
10
5 11
# Check whether I'm at home (yeah, I know...)
6 12
ping -c1 192.168.220.109 &> /dev/null
7 13
if [ $? != 0 ]; then