1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Scheduled FTP backups and unwanted 'server repository' copies

Discussion in 'Plesk 11.x for Linux' started by KeithSav, Aug 13, 2012.

  1. KeithSav

    KeithSav New Pleskian

    15
    60%
    Joined:
    Jan 21, 2011
    Messages:
    2
    Likes Received:
    0
    I am using 3 servers with Plesk 10 & 11 running 30+ websites. Each website has a scheduled account backup to a external FTP server. Every time the backups run a copy of the backup file gets stored in the 'Servers' repository. This occurs even though I have it set to only store the last 2 recent backups. As you can see this compounds local storage problems quickly. I may only have 2 backups on my FTP but 15-20 (since my last manual delete) in the servers repository.

    Does anyone have a workaround or fix for this issue?
     
  2. abdi

    abdi Platinum Pleskian

    31
    18%
    Joined:
    May 14, 2006
    Messages:
    2,913
    Likes Received:
    60
    Deleting Backups

    Usually if the backup has been moved to the FTP respitory successfully, then the local copy would be deleted.

    Optionally, Set a Cron Job to clean the local backup Resp.
    Code:
    vim /root/bk_cleanup.sh
    
    and add the following:

    Code:
    #!/bin/sh backup_dumps_delete#
    # Delete backup more than 90 days old.
    #
    backupDir="/var/lib/psa/dumps"
    #
    daysToKeep=30
    echo "Checking for files older than $daysToKeep days in $backupDir"
    listOfFiles=`find $backupDir -mtime +$daysToKeep`
    if [ ! -z $listOfFiles ]
    then
    echo "Found [$listOfFiles]"
    else
    echo "None found."
    fi
    for toDelete in $listOfFiles
    do
    echo "Deleting $toDelete"
    rm -rf $toDelete
    done
    echo "Done.
    
    then again,

    crontab -e

    and add the following line:

    0 1 * * * sh /root/bk_cleanup.sh
     
Loading...