khenderick/zfs-snap-manager

It doesn't take snapshots at all.

Closed this issue · 9 comments

Below is the content of /etc/zfssnapmanager.cfg

[user-data/data]
mountpoint = /mnt/data
time = 03:00
snapshot = True
schema = 7d0w0m0y

The output of zfs list

# zfs list
NAME             USED  AVAIL  REFER  MOUNTPOINT
user-data       1.07T  1.61T    96K  none
user-data/data  1.07T  1.61T  1.07T  /mnt/data

The output of systemctl status zfs-snap-manager

# systemctl status zfs-snap-manager
● zfs-snap-manager.service - ZFS Snapshot Manager
   Loaded: loaded (/usr/lib/systemd/system/zfs-snap-manager.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2015-01-30 16:58:14 KST; 4min 32s ago
  Process: 450 ExecStop=/usr/lib/zfs-snap-manager/manager.py stop (code=exited, status=0/SUCCESS)
 Main PID: 455 (manager.py)
   CGroup: /system.slice/zfs-snap-manager.service
           └─455 /usr/bin/python2 /usr/lib/zfs-snap-manager/manager.py start

Jan 30 16:58:14 arch-server systemd[1]: Started ZFS Snapshot Manager.

It should take a snapshot everyday, but it hasn't taken a single snapshot so far.

What is wrong?

Can you post the contents of /var/log/zfs-snap-manager.log and the output of zfs list -t snapshot? You can put it on pastie.org and post the link here as there might be quite some data.

# cat /var/log/zfs-snap-manager.log 
2014-12-27 15:00:04,941 - Starting up
2014-12-28 13:05:11,878 - Starting up
2014-12-28 20:19:35,208 - Starting up
2014-12-29 09:16:57,313 - Starting up
2014-12-29 09:46:51,187 - Starting up
2014-12-30 10:11:12,227 - Starting up
2015-01-04 10:29:01,325 - Starting up
2015-01-05 07:05:39,354 - Starting up
2015-01-05 09:25:04,364 - Starting up
2015-01-11 08:56:11,374 - Starting up
2015-01-11 09:10:56,869 - Starting up
2015-01-11 17:50:34,224 - Starting up
2015-01-12 00:11:43,160 - Starting up
2015-01-12 00:21:40,371 - Starting up
2015-01-12 00:29:39,269 - Starting up
2015-01-23 23:05:14,696 - Starting up
2015-01-28 18:14:19,415 - Starting up
2015-01-30 16:58:14,073 - Starting up
# zfs list -t snapshot
no datasets available

That's odd, I have no clue yet what's going on. Mind to give me the output of zfs list -H -s creation -t snapshot and zfs list -H?

zfs list -H -s creation -t snapshot prints nothing.

# zfs list -H
user-data   1.07T   1.61T   96K none
user-data/data  1.07T   1.61T   1.07T   /mnt/data

I've reproduced the issue and I'm working on a fix. I hope I can release somewhere this weekend. I'll keep you posted with progress.

Issue found and fixed. I'm now going to apply changes to my systems and let it run for a while to make sure there are no other issues popping up.

What were the issue and the fix?

In the Helper.py, there's a function run_command(command, cwd), that has some boilerplate code for running commands and stripping out unwanted characters. At this moment, I can't completely remember what characters were causing problems in the first place, but anyway, a dash (-) is obviously not at bad character.

The script was fetching your dataset as userdata instead of user-data causing it to think it had to be skipped because [userdata] isn't in your configuration file. It would give tons of issues on other places as well because, well, it's just not what your dataset is named.

Thanks...