[ Index ] |
PHP Cross Reference of Unnamed Project |
[Summary view] [Print] [Text view]
1 #!/bin/sh 2 # 3 # $Id: move_rep_backuppc.sh 5732 2010-07-12 17:34:42Z plouf $ # 4 # 5 6 # 7 # Deplace le repertoire /var/lib/backuppc vers un autre disque, en creant un lien symbolique 8 # Supprime completement une sauvegarde en fonction du nom de la machine 9 # 10 11 12 if [ -f /tmp/move_backuppc.lock ] 13 then 14 echo "Lock trouv�" 15 logger -t "BackupPc" "Lock trouv�..." 16 else 17 18 if [ "$1" = "" -o "$2" = "" ] 19 then 20 echo Syntaxe : move_rep_backup source destination 21 logger -t "BackupPc" "Erreur : impossible de copier" 22 exit; 23 fi 24 25 if [ "$1" = "delete" -a "$2" != "" ] 26 then 27 rm -Rf /var/lib/backuppc/pc/$2 28 exit 29 fi 30 31 # On place un lock 32 touch /tmp/move_backuppc.lock 33 34 # On copie le r�pertoire backuppc vers la nouvelle destination 35 # Cas ou on essaye de revenir dans /var/lib 36 if [ "$2" = "/var/lib/backuppc" ] 37 then 38 if [ -L "/var/lib/backuppc" ] 39 then 40 rm -f /var/lib/backuppc 41 fi 42 fi 43 mv $1 $2 44 logger -t "BackupPc" "Repertoire d�plac� de $1 vers $2" 45 46 # On recr�e le lien symb de /var/lib/backuppc 47 if [ "$?" = "0" ] 48 then 49 if [ -L "/var/lib/backuppc" -o ! -d "/var/lib/backuppc" ] 50 then 51 rm -f /var/lib/backuppc 52 fi 53 ln -s $2 /var/lib/backuppc 54 55 # On donne les droits a www-se3 sur $2 56 # chown -R www-se3.root $2 57 58 # On relance backuppc 59 /etc/init.d/backuppc stop 60 /etc/init.d/backuppc start 61 else 62 echo "Echec" 63 fi 64 # on flingue le lock 65 if [ -f /tmp/move_backuppc.lock ] 66 then 67 rm -f /tmp/move_backuppc.lock 68 fi 69 fi 70
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Tue Mar 17 22:47:18 2015 | Cross-referenced by PHPXref 0.7.1 |