dataset/seed/dovecot/templates/risotto_backup

22 lines
449 B
Text
Raw Normal View History

2023-06-23 08:12:05 +02:00
#!/bin/bash
2023-06-23 08:12:05 +02:00
BACKUP_DIR="{{ general.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
2023-06-23 08:12:05 +02:00
fi
done
rm -f $BACKUP_DIR/*.done
exit 0