dataset/seed/dovecot/templates/risotto_backup

22 lines
469 B
Text
Raw Permalink 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
2024-09-10 13:41:03 +02:00
doveadm -o mail_fsync=never 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