add hourly /var/home snapshot script and cronjob
This commit is contained in:
parent
c65e1081a0
commit
9d952af895
2 changed files with 11 additions and 0 deletions
3
etc/cron.hourly/2snapshot
Executable file
3
etc/cron.hourly/2snapshot
Executable file
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
python3 "/usr/bin/snapshot-home.py"
|
||||||
8
usr/bin/snapshot-home.py
Executable file
8
usr/bin/snapshot-home.py
Executable file
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/usr/bin/python3 -u
|
||||||
|
|
||||||
|
import os
|
||||||
|
import datetime
|
||||||
|
|
||||||
|
stream = os.popen('btrfs subvolume snapshot /var/home /var/.snapshot.home/' + datetime.datetime.now().strftime("%Y.%m.%d_%H:%M:%S") + '/')
|
||||||
|
output = stream.read()
|
||||||
|
print(output)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue