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