dataset/seed/dovecot/templates/risotto_backup

21 lines
445 B
Text

%echo "#!/bin/bash"
BACKUP_DIR="%%backup_dir"
mkdir -p $BACKUP_DIR
chown vmail: $BACKUP_DIR
rm -f $BACKUP_DIR/*.done
find /srv/home/ -name *@* -type d -printf "%f\n" | while read user; do
doveadm backup -u $user maildir:$BACKUP_DIR/$user
touch $BACKUP_DIR/$user.done
done
ls $BACKUP_DIR | while read $user; do
if [ ! -f $BACKUP_DIR/$user.done ]; then
rm -rf $BACKUP_DIR/$user
if
done
rm -f $BACKUP_DIR/*.done
exit 0