mirror of
https://github.com/tuna/tunasync.git
synced 2025-06-12 03:12:47 +00:00
existed working dir
This commit is contained in:
parent
1ce19c88b1
commit
9fc1e6d9ec
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python2
|
||||
# -*- coding:utf-8 -*-
|
||||
import sh
|
||||
import os
|
||||
|
||||
|
||||
class BtrfsVolumeError(Exception):
|
||||
@ -33,8 +34,11 @@ class BtrfsHook(object):
|
||||
|
||||
def _create_working_snapshot(self):
|
||||
self._ensure_subvolume()
|
||||
# print("btrfs subvolume snapshot {} {}".format(self.service_dir, self.working_dir))
|
||||
sh.btrfs("subvolume", "snapshot", self.service_dir, self.working_dir)
|
||||
if os.path.exists(self.working_dir):
|
||||
print("Warning: working dir existed, are you sure no rsync job is running?")
|
||||
else:
|
||||
# print("btrfs subvolume snapshot {} {}".format(self.service_dir, self.working_dir))
|
||||
sh.btrfs("subvolume", "snapshot", self.service_dir, self.working_dir)
|
||||
|
||||
def _commit_changes(self):
|
||||
self._ensure_subvolume()
|
||||
|
Loading…
x
Reference in New Issue
Block a user