[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-backup/usr/share/se3/scripts/ -> startbackup (source)

   1  #!/bin/bash
   2  #
   3  ### $Id: startbackup 8394 2015-01-24 22:42:47Z keyser $ ###
   4  #
   5  
   6  ##### Script pour lancer ou stopper  via sudo backuppc #####
   7  
   8  if [ ! -d /var/lib/backuppc/pc ]; then
   9  mkdir /var/lib/backuppc/pc
  10  chown backuppc:backuppc /var/lib/backuppc/pc
  11  fi
  12  
  13  if [ ! -d /var/lib/backuppc/cpool ]; then
  14  mkdir /var/lib/backuppc/cpool
  15  chown backuppc:backuppc /var/lib/backuppc/cpool
  16  fi
  17  
  18  if [ "$1" = "stop" -o  "$1" = "start"  -o  "$1" = "reload"  -o  "$1" = "restart" ]
  19  then
  20      /etc/init.d/backuppc $1
  21  else 
  22      echo "startbackup [start|stop|reload|restart]"
  23      exit 1;
  24  fi    
  25  
  26  if [ "$1" == "stop" ]
  27  then
  28      update-rc.d -f backuppc remove
  29      update-rc.d -f backuppc stop 0 1 2 3 4 5 6 .
  30  
  31      # On vérifie (semble pas toujours vouloir stopper)
  32      if [ "`/bin/ps awux | grep BackupPC_trashClean | grep -v grep`" != "" ]
  33      then
  34          killall -9 BackupPC_trashClean
  35      fi
  36      if [ "`/bin/ps awux | grep BackupPC | grep -v grep`" != "" ]
  37      then
  38          killall -9 BackupPC
  39      fi
  40  
  41  fi
  42  if [ "$1" = "start" ]
  43  then
  44      ps ax|grep BackupPC >/dev/null|| (
  45          echo "Correction droits sur backuppc"
  46          /usr/share/se3/sbin/permbackuppc.sh
  47          /etc/init.d/backuppc start
  48      )
  49      update-rc.d -f backuppc remove
  50      update-rc.d backuppc defaults
  51  
  52  fi    


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1