diff --git a/etc/cron.hourly/2snapshot b/etc/cron.hourly/2snapshot new file mode 100755 index 0000000..ffc03c8 --- /dev/null +++ b/etc/cron.hourly/2snapshot @@ -0,0 +1,3 @@ +#!/bin/sh + +python3 "/usr/bin/snapshot-home.py" diff --git a/usr/bin/snapshot-home.py b/usr/bin/snapshot-home.py new file mode 100755 index 0000000..e7d02db --- /dev/null +++ b/usr/bin/snapshot-home.py @@ -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)