Создаём исполняемый bash файл
nano /root/xtrabackup.sh
#!/bin/bash # каталог для хранения резервных копий documentroot="/backup/databases/xtrabackup/" # количество копий count=14 i=`ls -C1 $documentroot | wc -l` if [[ $i -eq $count ]]; then del=`ls -C1 $documentroot | head -n1` `rm -rf "$documentroot$del"` fi /usr/bin/innobackupex /backup/databases/xtrabackup
И добавляем задание в планировщик
crontab -e
0 2 * * * /bin/bash /root/xtrabackup.sh