Skip to content

Commit 30719c8

Browse files
committed
Increase the warm up time to 3 minutes, add requirements info, disable NoSleep on right place.
1 parent 29303b8 commit 30719c8

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tmutil-safe-nas-backup

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#!/bin/bash
2+
# Author: http://brablc.com/
3+
# Repo: https://github.com/brablc/clit/blob/master/tmutil-safe-nas-backup
4+
#
5+
# Requirements: NoSleepCtrl from http://code.google.com/p/macosx-nosleep-extension/issues/detail?id=28#c8 - take Volanins built (see the issue)
26

37
function tmrunning() {
48
return $([ $(tmutil currentphase) != 'BackupNotRunning' ])
@@ -29,7 +33,7 @@ function tmrun() {
2933
tmutil startbackup
3034
echostate -n I "Waiting for backup to come up ... "
3135

32-
MAXWAIT=60
36+
MAXWAIT=180
3337
for I in `seq 1 $MAXWAIT`; do
3438
if tmrunning; then
3539
break;
@@ -51,13 +55,13 @@ function tmrun() {
5155
sleep 10
5256
done
5357

54-
if [ $HASNOSLEEP ]; then
55-
echostate I "Returning NoSleep to original state."
56-
NoSleepCtrl -s $NOSLEEPSAVESTATE
57-
fi
58-
5958
echostate I "Finished backup."
6059
fi
60+
61+
if [ $HASNOSLEEP ]; then
62+
echostate I "Returning NoSleep to original state."
63+
NoSleepCtrl -s $NOSLEEPSAVESTATE
64+
fi
6165
}
6266

6367
if tmrunning; then

0 commit comments

Comments
 (0)