sukria / Backup-Manager

Versatile yet easy to use command line backup tool for GNU/Linux. Suitable for desktop and servers.
http://www.backup-manager.org/
GNU General Public License v2.0
279 stars 90 forks source link

backup-manager didn't delete old backup files #5

Closed MurzNN closed 7 years ago

MurzNN commented 14 years ago

Config file is: export BM_REPOSITORY_ROOT="/backups/org/projects" export BM_TEMP_DIR="/tmp" export BM_REPOSITORY_SECURE="true" export BM_REPOSITORY_USER="root" export BM_REPOSITORY_GROUP="root" export BM_REPOSITORY_CHMOD="770" export BM_ARCHIVE_CHMOD="660" export BM_ARCHIVE_TTL="10" export BM_ARCHIVE_STRICTPURGE="false" export BM_ARCHIVE_NICE_LEVEL="10" export BM_ARCHIVE_METHOD="tarball-incremental"

export BM_TARBALL_NAMEFORMAT="short" export BM_TARBALL_FILETYPE="tar.gz" export BM_TARBALL_OVER_SSH="false" export BM_TARBALL_DUMPSYMLINKS="false"

export BM_TARBALL_DIRECTORIES="/store/org/projects"

export BM_TARBALL_BLACKLIST="*/nobackup" export BM_TARBALL_EXTRA_OPTIONS=""

export BM_TARBALLINC_MASTERDATETYPE="weekly" export BM_TARBALLINC_MASTERDATEVALUE="5"

export BM_LOGGER="true" export BM_LOGGER_FACILITY="user" export BM_PRE_BACKUP_COMMAND="" export BM_POST_BACKUP_COMMAND=""

It creates master and increment archives successfully, but don't remove files older that 10 days. Version is 0.7.9-3 on Debian Squeeze.

What is wrong in config file? How can I debug all the process? Adding "--verbose" didn't help, output is only: When validating the configuration file /etc/backup-manager.conf, 4 warnings were found.

MurzNN commented 14 years ago

If I comment string export BM_TARBALL_NAMEFORMAT="short" it removes old files succesfully! So the bug is near this option.

Seems that script /usr/bin/backup-manager-purge don't look at this ENV value and check only long filenames

althaus commented 13 years ago

I've got the same problem. Will try MurzNN's solution.

ghost commented 11 years ago

I know it's been stale a while, but since this issue still appears to be open: I have this problem too, also on Debian Squeeze, version 0.7.9. MurzNN's solution works. I did some digging and found out why; the expression backup-manager-purge uses to identify archives expects a hyphen between the hostname and directory, but the short nameformat doesn't include one.

Looking at the commit history I see that this is probably fixed in 0.7.10; Squeeze just has an outdated version. If anyone else still on Squeeze sees this, you can fix it by setting BM_TARBALL_NAMEFORMAT="long", or by looking in files.sh->get_dir_name() and changing dirname=$directory to dirname=-$directory, which will supply the expected hyphen. Or just use the current release off github.

Adding the hyphen manually to existing archives seems to get them monitored. Not sure how that interacts with things like incrementals, though.

(I'm posting this explanation even though it appears to already be fixed, because this is where I ended up when looking for a solution; it might save someone time in future)

webscreen commented 9 years ago

Hi there,

i'm using the last version of backup-manager and i've got the same problem...

Backup-manager didn't delete old backup files by the FTP method. All files are correctly deleted in the archives folder (BM_REPOSITORY_ROOT="/var/archives") but not on the remote FTP server.

I'm using the ftp method : export BM_UPLOAD_FTP_SECURE="false" export BM_UPLOAD_FTP_PASSIVE="true" export BM_UPLOAD_FTP_TEST="false" export BM_UPLOAD_FTP_USER="xxxxxxxxx.xxx.net" export BM_UPLOAD_FTP_PASSWORD="xxxxxxxxxxx" export BM_UPLOAD_FTP_HOSTS="xxxxxxxxxxx.net" export BM_UPLOAD_FTP_PURGE="true" export BM_UPLOAD_FTP_TTL="4" export BM_UPLOAD_FTP_DESTINATION="/test/"

It creates master and increment archives successfully, but don't remove files older that 4 days. Evertything else is correct, i've got 0 error adding "--verbose" didn't help.

What's wrong ?

Version is 0.7.10 on CentOS 6.

chandon commented 7 years ago

@webscreen this is because #91

Vagrantin commented 7 years ago

I'm also experiencing the issue on Debian Jessie with backup-manager 0.7.12-debian1, i have set export BM_ARCHIVE_TTL="5" export BM_TARBALL_NAMEFORMAT="long" And the clean up is not perform locally, does somebody manage to drill down this issue ?

kissifrot commented 7 years ago

@Vagrantin Could you try with latest version in devel branch ?

Vagrantin commented 7 years ago

@kissifrot no, I have to look at that, but it will take me a bit of time as I guess it's not packaged for Debian :D Today my work around is to cron a backup-manager -p on a daily basis otherwise it doesn't clean up old backup.