cPanel backup script moving files to wrong folder

Asked

Viewed 32 times

0

I have this full cPanel backup script that works well: (https://github.com/pietromalerba/cPanel-Full-Backup-Script).

I followed exactly the orientation settings, 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 from it, when the script again runs the file back up to be moved to the daily folder, thus mixing with the other files, incorrectly.

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

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

Would anyone know how to fix this?

1 answer

0


Resolved by changing line 47 to:

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.