adamfeuer / rotate-backups

Rotate Backups - keep hourly, daily, and weekly backups
Other
82 stars 25 forks source link

Fixes for the Issues #4 and #6 #7

Closed ghost closed 11 years ago

ghost commented 11 years ago

The check in move_to which ensures the destination folder exist checks for the whole destination path. Therefore it generates a directory in the destination folder named after the file and puts it inside this folder.

Issue #4 shuold by fixed because the generation of extra directorys is eleminated. Issue #6 should be fixed because the folders aren't generated anymore. Your script assumed they where files therefore the remove failed.

fhlongwong commented 11 years ago

Meant to say moved only one daily into the weeklys. There are no files in my dailys folder.

fhlongwong commented 11 years ago

Update: Aentfs's fix does actually work (I wasn't disappointed in your work, just that I lost my files) I had to wait a couple of days for the dailys to kick in. What I think experienced is this -- while I was uncompressing the files out from the "directories" it naturally created a modified timestamp of "today" for all the files. I suspect that when I ran the rotate script it deleted the files because they were all timestamped "today". So I am raising the possible issue that the script works against the file timestamp and not the file_name timestamp, as I think it should for integrity. Can someone confirm this?

ghost commented 11 years ago

I can't confirm nor decline this. But as far as I see, it takes the date out of the filename. If the filename doesn't contain the date in a special format, it will create it from the file timestamp. Even if it don't takes the filename as backupdate, it should only move files from dailies that are older than 7 days. Strange is, it deleted everything, exept one file. How many files did you had in your daily folder?

I will test the script behavior within the next few days.

P.S. Sorry, I thought you meant my patch, therefore I was a bit enraged.

fhlongwong commented 11 years ago

I had just over one month worth of files.

ghost commented 11 years ago

I tested the script and it works with the filename, except the name doesn't contain the date then it generates the filename with date out of the file properties.

In the backups you had, were there missing days, i.e. days you hadn't made backups? I can't think of any other reason, why the script should have deleted your backups.

fhlongwong commented 11 years ago

I don't recall if I was missing any backup days? Would this have caused the deleted backups?

ghost commented 11 years ago

The rotation script only moves the backups that are created on the day which you configured in the settings. So for example, if you had missed every monday backup and the script is configured to only move monday backups then no backup would be moved and every other backup would be deleted as usual.

tuxillator commented 11 years ago

Works for me, fixes both issues #4 and #6 as it says on the box! Thanks.