# today
DATE=$(date +%Y%m%d)

BACKUP_DIR="/data/os_backup_$DATE"

if [ ! -d "$BACKUP_DIR" ]; then
    mkdir -p "$BACKUP_DIR"

fi

rsync -aAXv --progress --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/logpresso/*"} / "$BACKUP_DIR/"

# print complete message
echo "backup complete : $BACKUP_DIR"
