Hi,
We are taking backups for ldap instances, and with the new requirement would like to keep 1 day's of backup to local disk (/export1) and rest 14 days backup to SAN (/export2). Now we are in kind of fix on how to move the backups ( includes files & folders) to SAN and check if the move has been completed. We use the following subroutine for this. Is there any way we can check the moved backups, i mean in terms of size. Just in order in avoid a kind of situation where we have moved the backup and the size differs.
We would like to update the script to following things:
- Delete backups older than 15 days in /export2.
- Move previous day's backup from /export1 to /export2.
- check move completed successfully on /export2.
- Take backup of /export1.
P.S : This is not the complete script so please ignore variables. Also, i am only need commands and not a different script.
deletionandbackup2()
{
# Remove all old back up greater than retention period
find $BACKUPDIR/$1 -type f -mtime +$RETENTION_PERIOD -name "$1-*.ldif" -exec rm -f \{\} \;
# Backup ldap
$BASEDIR/$1/db2ldif -a $BACKUPDIR/$1/$1-$DATE.ldif -n $2 -n $3
$sleep_backup
}
Thanks in Advance.
Prince