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

[fix] Backup delete should delete symlink target #738

Merged

Conversation

Projects
None yet
2 participants
@alexAubin
Copy link
Member

commented Jun 18, 2019

The problem

Today a user on the chat pointed out that, when creating backups in a custom output directory (e.g. /tmp/backups/) then deleting the backup using yunohost backup delete, the .tar.gz file is still in /tmp/backups/

Solution

That's because backup_delete() naively deletes /home/yunohost.backup/archives/thebackup.tar.gz, which turns out to exist and is a symlink to the actual archive in /tmp/backups/. So the solution is to also delete the target of the symlink (if the path is a symlink).

PR Status

Tested on my machine and working

How to test

yunohost backup create foo -o /tmp/backups/
ls /tmp/backups/  # Should display an archive for foo
yunohost backup delete foo
ls /tmp/backups/  # foo shouldn't be there anymore with this fix

Validation

  • Principle agreement 0/2 :
  • Quick review 0/1 :
  • Simple test 0/1 :
  • Deep review 0/1 :
@decentral1se
Copy link
Contributor

left a comment

🚀

Show resolved Hide resolved src/yunohost/backup.py

@alexAubin alexAubin added this to the 3.6.x milestone Jun 24, 2019

@alexAubin

This comment has been minimized.

Copy link
Member Author

commented Jun 24, 2019

k folks, mergin' this one because it's a small ~simple fix..

@alexAubin alexAubin merged commit 40de700 into stretch-unstable Jun 24, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@alexAubin alexAubin deleted the backup-delete-should-delete-symlink-target branch Jun 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.