New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timezone in TimeFormat variable? #2065

Open
pabs3 opened this Issue Oct 28, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@pabs3

pabs3 commented Oct 28, 2018

Output of restic version

$ restic version
restic 0.9.2 compiled with go1.10.3 on linux/amd64

Describe the issue

I'm importing backups from another backup system (rdiff-backup) that uses the local time (instead of UTC) for snapshots (like restic does).

I am doing the conversion like this and getting an error parsing the time:

$ rdiff-backup --list-increments /media/backup/rdiff/ | sponge | head -n2
Found 1234 increments:
    increments.2010-07-04T01:37:29+08:00.dir   Sun Jul  4 01:37:29 2010
$ time="2010-07-04 01:37:29+08:00"
$ rdiff-backup --restore-as-of "$time" /media/backup/rdiff /media/restore/rdiff/"$time"
$ cd /media/restore/rdiff/"$time"
$ restic backup --time "$time" --verbose --one-file-system --repo /media/backup/restic/ *
Fatal: error in time option: parsing time "2010-07-04 01:37:29+08:00": extra text: +08:00

I also tried passing the time in UTC and that works but it results in a snapshot timestamp of 2010-07-03T17:37:29Z which loses the timezone information that restic snapshots normally have.

If the TimeFormat variable is changed to include the timezone specification, then there will be a backwards compatibility issue and everyone using --time will have to change their code.

Another alternative would be to add a --time-format option similar to the restic mount --snapshot-template option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment