mirror of
https://github.com/elliotnunn/empw.git
synced 2025-08-07 16:25:00 +00:00
Hide ephemeral files from Time Machine
This commit is contained in:
1
empw
1
empw
@@ -216,6 +216,7 @@ hsyncback = path.join(scriptfolder, 'hsyncback')
|
||||
if not path.exists(bootimg):
|
||||
print('Creating new scratch boot disk.')
|
||||
copyfile(backupimg, bootimg)
|
||||
run(['xattr', '-w', 'com.apple.metadata:com_apple_backup_excludeItem', 'com.apple.backupd', bootimg])
|
||||
|
||||
|
||||
|
||||
|
2
hsync
2
hsync
@@ -48,6 +48,8 @@ label = 'Src'
|
||||
# Dirs are in /full/path/without/trailing/slash form, thanks to os.path.abspath
|
||||
|
||||
if not path.exists(srcimg):
|
||||
run(['touch', srcimg])
|
||||
run(['xattr', '-w', 'com.apple.metadata:com_apple_backup_excludeItem', 'com.apple.backupd', srcimg])
|
||||
run(['dd', 'if=/dev/zero', 'of='+srcimg, 'bs=1048576', 'count='+str(256)], stdout=DEVNULL, stderr=DEVNULL, check=True)
|
||||
run(['hformat', '-l', label, srcimg], stdout=DEVNULL, check=True)
|
||||
run(['humount'], check=True)
|
||||
|
Reference in New Issue
Block a user