cPanel backup script moving files to wrong folder

0

I have this cPanel full backup script that works fine: ( link ).

p>

I followed exactly the orientation settings, I created two folders /backups/backup_daily and /backups/backup_monthly and the corresponding cron jobs.

The problem is that the monthly backup is always being moved to the daily backup folder.

And even if I manually move the monthly backup file to the correct folder of it, when the script runs again the file will be moved back to the daily folder, thus mingling with the other files, incorrectly.

I think the problem is at line 47 of backup.sh :

find $HOME -type f -name "backup-*" -exec mv {} $BACKUP_FOLDER/ \;

Would anyone know how to fix this?

    
asked by anonymous 06.05.2018 / 03:38

1 answer

0

Solved by changing line 47 to:

find $HOME/* -maxdepth 0 -type f -name "backup-*" -exec mv {} $BACKUP_FOLDER/ \;
    
08.05.2018 / 19:18