wok-6.x annotate backuppc/stuff/etc/BackupPC/shutdown.sh @ rev 9282
Add backuppc
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Mar 16 09:13:12 2011 +0100 (2011-03-16) |
parents | |
children |
rev | line source |
---|---|
pascal@9282 | 1 #!/bin/sh |
pascal@9282 | 2 |
pascal@9282 | 3 # In /etc/BackupPC/config.pl: |
pascal@9282 | 4 # $Conf{DumpPostUserCmd} = '/etc/backuppc/shutdown.sh $host $xferOK'; |
pascal@9282 | 5 |
pascal@9282 | 6 ADMUSER=administrator |
pascal@9282 | 7 ADMPASS=passwdadministrator |
pascal@9282 | 8 |
pascal@9282 | 9 if [ $(date +%k) -lt 07 -o $(date +%k ) -gt 20 ]; then |
pascal@9282 | 10 /usr/bin/net rpc SHUTDOWN -f -I $1 -U $ADMUSER%$ADMPASS -t 30 |
pascal@9282 | 11 else |
pascal@9282 | 12 msg="Backup failed." |
pascal@9282 | 13 [ $2 = 1 ] && msg="Backup successful." |
pascal@9282 | 14 echo "$msg" | smbclient -M $1 --user="backuppc" |
pascal@9282 | 15 fi |