Support » Plugin: CYAN Backup » Old backup files not being deleted

  • Resolved i2000s

    (@i2000s)


    Hi there,

    I started using Cyan for automatic backups, but found the old backups cannot be deleted automatically in my test. What I did in my test is to set “enable pruning” and “number of backups: 1”, and then did two backups manually by hand. The result is that both backups were retained, while I expect the older copy will be pruned automatically when the second backup started. Is the automatic pruning function working in normal cases?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Greg Ross

    (@gregross)

    It should delete them, have you tried manually deleting them (through the CYAN Backup UI)?

    It might be a permissions problem, double check the file permissions and make sure the web server user has permissions to delete the files.

    @greg Ross, although I put the backup directory to my home directory, it worked if I delete the backups manually on the CYAN interface. Then I tested moving the backup directory to my WordPress subfolders where the WordPress users definitely have permission to delete files, I got the same result. That is, when I create multiple backups in a roll manually, the older backups won’t be deleted automatically even though I set up the Number of Backups to be 1. Did I miss anything in the setting? Thanks!

    Plugin Author Greg Ross

    (@gregross)

    That should be everything you have to do, I’ll take a look and see if there’s a bug in it somewhere.

    In the mean time, try setting it to 2 or 3 and see if it works.

    Sorry, I don’t have enough space to test backup with 3 copies on my server. 2 copies have been very close to the upper limit. I appreciate your efforts!

    Plugin Author Greg Ross

    (@gregross)

    Ok, I found the issue, line 1461 of cyan-backup.php is:

    
    if (count($backup_files) > $number && $number > 1) {
    

    but should be:

    
    if (count($backup_files) > $number && $number >= 1) {
    

    So there has to be at least 2 backups, otherwise it won’t prune them.

    @gregross, I replaced the line, and it works like a charm! Thank you very much for taking care of this issue.

    Just one side question: I am considering to set up a remote server to store all the backups offline. I can set up the remote path but does the “Number of Backups to keep” in the “Storage Maintenance” submenu also refer to the copies on the remote server? Or, in other words, the old remote copies will also be deleted when a new copy arrives?

    Also, there is a small typo on the interface of “Remote storage” submenu: “You many use the follow place holders: %m = month (01-12), %d = day (01-31), %Y = year (XXXX), %M = month (Jan…Dec), %F = month (January…December)”. The word “many” should be “may”, I think.

    Thanks!
    Qi

    Plugin Author Greg Ross

    (@gregross)

    No, management of remote storage is not part of CYAN Backup, it just sends the backup to the remote location it’s up to the remote server to handle any removal of old backup files.

    Thanks for the typo, I’ll fix it.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Old backup files not being deleted’ is closed to new replies.