瀏覽代碼

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

Lucas Stadler 13 年之前
父節點
當前提交
f53a291dee
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      .rsync-backup.sh

+ 6 - 0
.rsync-backup.sh

2
2
3
# rsync's $HOME to my local backup server.
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
# Check whether I'm at home (yeah, I know...)
11
# Check whether I'm at home (yeah, I know...)
6
ping -c1 192.168.220.109 &> /dev/null
12
ping -c1 192.168.220.109 &> /dev/null
7
if [ $? != 0 ]; then
13
if [ $? != 0 ]; then