/usr/local/directadmin/scripts/custom/user_backup_post.sh
/usr/local/directadmin/scripts/custom/user_backup_pre.sh
mkdir /home/admin/admin_backups_$(date +\%m_\%d_\%Y)
mv /home/admin/admin_backups/* /home/admin/admin_backups_$(date +\%m_\%d_\%Y)
if [ -d /backup/$(date +\%Y) ]; then
if [ -d /backup/$(date +\%Y)/$(date +\%m) ]; then
if [ -d /backup/$(date +\%Y)/$(date +\%m)/$(date +\%d) ]; then
else
mkdir /backup/$(date +\%Y)/$(date +\%m)/$(date +\%d)
fi
else
mkdir /backup/$(date +\%Y)/$(date +\%m)
mkdir /backup/$(date +\%Y)/$(date +\%m)/$(date +\%d)
fi
else
mkdir /backup/$(date +\%Y)
mkdir /backup/$(date +\%Y)/$(date +\%m)
mkdir /backup/$(date +\%Y)/$(date +\%m)/$(date +\%d)
fi
DIR=/backup/`date +%Y/%m/%d`
if [ ! -d $DIR ]; then
mkdir -p $DIR;
fi;
-p, --parents
no error if existing, make parent directories as needed
find /backup/ -mtime +10 -delete
find: cannot delete /backup/path/to/dir: Directory not empty
find: cannot delete /backup/path/to: Directory not empty