Skip to content
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

ValueError exception trying to expire backups #67

Open
dregad opened this issue May 29, 2021 · 0 comments
Open

ValueError exception trying to expire backups #67

dregad opened this issue May 29, 2021 · 0 comments

Comments

@dregad
Copy link

dregad commented May 29, 2021

Hello,

I came upon this script, looking for a solution to cleanup old backups.

This maybe a silly newbie question, but at my first experimentation with a dry-run expire command (following indications in the README file), the program crashed with the following trace:

# tarsnapper --target "mantisbt_org_\$date" --deltas 1d 30d 360d - expire --dry-run 
1193 backups are matching
Traceback (most recent call last):
  File "/usr/local/bin/tarsnapper", line 8, in <module>
    sys.exit(run())
  File "/usr/local/lib/python3.8/dist-packages/tarsnapper/script.py", line 556, in run
    sys.exit(main(sys.argv[1:]) or 0)
  File "/usr/local/lib/python3.8/dist-packages/tarsnapper/script.py", line 546, in main
    command.run(job)
  File "/usr/local/lib/python3.8/dist-packages/tarsnapper/script.py", line 324, in run
    self.expire(job)
  File "/usr/local/lib/python3.8/dist-packages/tarsnapper/script.py", line 321, in expire
    self.backend.expire(job)
  File "/usr/local/lib/python3.8/dist-packages/tarsnapper/script.py", line 185, in expire
    to_keep = expire.expire(backups, job.deltas)
  File "/usr/local/lib/python3.8/dist-packages/tarsnapper/expire.py", line 50, in expire
    backups = sorted(backups.items(), key=lambda x: x[1], reverse=True)
ValueError: offset must be a timedelta strictly between -timedelta(hours=24) and timedelta(hours=24).

I'm not sure what to make of this error, or how to fix it. Thanks in advance for your help !

Please find attached the output of tarsnap --list-archives for reference
list-archives-20210529.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant