files_snapshots icon indicating copy to clipboard operation
files_snapshots copied to clipboard

Time formatting for zfs snapshots

Open minorsecond opened this issue 7 years ago • 11 comments

I'm trying to figure out how to set the formatting for the following:

zfs-auto-snap_frequent-2017-06-23-1930

I've got Y-m-d-Hi, but that doesn't work. I also tried Y-M-d-HH, which doesn't work either.

minorsecond avatar Jun 23 '17 20:06 minorsecond

Y-m-d-HM if it's like the unix date command, did you try that?

AceSlash avatar Jun 26 '17 18:06 AceSlash

Thanks. I tried that as well:

screen shot 2017-06-26 at 4 32 14 pm

I'm assuming that the date should appear under "Date."

minorsecond avatar Jun 26 '17 21:06 minorsecond

Have you tried *Y-m-d-Hi

tacruc avatar Jun 30 '17 14:06 tacruc

I am also having this same problem. My snapshots are named the same as well. I've tried the * as well. I've tried the date command format. My data directory is not in my nextcloud folder but in it's own zfs dataset.

snapshots_no_date

Ryushin avatar Nov 15 '17 15:11 Ryushin

Try *Y-m-d-Hi More: http://php.net/manual/de/datetime.createfromformat.php

M expect a text representation of the Month

tacruc avatar Nov 22 '17 08:11 tacruc

Afraid I tried that one as well before. Can you take a manual snapshot with that name and see if your installation can detect it. I've tried a bunch of variations. I even tried creating a manual snapshot named autosnap_2017_11_22_06:50:01_hourly and it still did not pick it up when I used the example on your git home page.

Ryushin avatar Nov 22 '17 14:11 Ryushin

My test installation is offline right now and will stay for a while, my production installation is on a different setup so the app is not installed sorry.

tacruc avatar Nov 22 '17 15:11 tacruc

I think -*-*-Y-m-d-Hi is what you need. Here is the php code I tried it with: http://sandbox.onlinephpfunctions.com/code/7487c65221842b5315cf227f2492143d76b3aee8

tacruc avatar Nov 23 '17 17:11 tacruc

Score!! The crowd goes wild! Thanks so much.

Ryushin avatar Nov 23 '17 17:11 Ryushin

I am struggling to find the proper formatting as well. My snapshots are called "auto-20181228.1200-2w". I have tried to get it to recognize for 2 hours. No dice. Can anyone enlighten me?

Yagu-znal avatar Jan 11 '19 01:01 Yagu-znal

Same problem with time format. Name is "zfs-auto-snap_weekly-2019-08-19-10h23" how to set ? ---Y-m-d-Hi this format not work 123 Without asterisk * in start line - work!

StreamThreader avatar Aug 19 '19 08:08 StreamThreader