changement du path btrfs

This commit is contained in:
Vincent MAUGER 2020-06-11 11:42:30 +02:00 committed by Denis Cardon
parent 26c45f3fe6
commit 82ca9dfa35
3 changed files with 4 additions and 4 deletions

View File

@ -68,7 +68,7 @@ class backup_rsync_btrfs(backup_generic):
dest_dir = os.path.join(self.backup_dir,'last_backup') dest_dir = os.path.join(self.backup_dir,'last_backup')
if not os.path.isdir(dest_dir): if not os.path.isdir(dest_dir):
if not self.dry_run: if not self.dry_run:
cmd = "/sbin/btrfs subvolume create %s"%dest_dir cmd = "/bin/btrfs subvolume create %s"%dest_dir
process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True) process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True)
log = monitor_stdout(process,'',self) log = monitor_stdout(process,'',self)
returncode = process.returncode returncode = process.returncode
@ -210,7 +210,7 @@ class backup_rsync_btrfs(backup_generic):
self.logger.debug("[%s] snapshoting last_backup directory from %s to %s" ,self.backup_name,dest_dir,finaldest) self.logger.debug("[%s] snapshoting last_backup directory from %s to %s" ,self.backup_name,dest_dir,finaldest)
if not os.path.isdir(finaldest): if not os.path.isdir(finaldest):
if not self.dry_run: if not self.dry_run:
cmd = "/sbin/btrfs subvolume snapshot %s %s"%(dest_dir,finaldest) cmd = "/bin/btrfs subvolume snapshot %s %s"%(dest_dir,finaldest)
process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True) process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True)
log = monitor_stdout(process,'',self) log = monitor_stdout(process,'',self)
returncode = process.returncode returncode = process.returncode

View File

@ -778,7 +778,7 @@ class backup_generic:
self.logger.info('[%s] removing directory "%s"',self.backup_name,oldbackup_location) self.logger.info('[%s] removing directory "%s"',self.backup_name,oldbackup_location)
if not self.dry_run: if not self.dry_run:
if self.type =="rsync+btrfs+ssh" or self.type == "rsync+btrfs": if self.type =="rsync+btrfs+ssh" or self.type == "rsync+btrfs":
cmd = "/sbin/btrfs subvolume delete %s"%oldbackup_location.encode('ascii') cmd = "/bin/btrfs subvolume delete %s"%oldbackup_location.encode('ascii')
process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True) process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True)
log = monitor_stdout(process,'',self) log = monitor_stdout(process,'',self)
returncode = process.returncode returncode = process.returncode

View File

@ -15,7 +15,7 @@ for backup in backups:
base_dir = os.path.join(backup_base_dir,backup) base_dir = os.path.join(backup_base_dir,backup)
dest_dir = os.path.join(base_dir, 'last_backup') dest_dir = os.path.join(base_dir, 'last_backup')
if not os.path.isdir(dest_dir): if not os.path.isdir(dest_dir):
cmd = "/sbin/btrfs subvolume create %s"%dest_dir cmd = "/bin/btrfs subvolume create %s"%dest_dir
print 'btrfs subvolume create "%s"' %dest_dir print 'btrfs subvolume create "%s"' %dest_dir
print subprocess.check_output(cmd, shell=True) print subprocess.check_output(cmd, shell=True)