firefox-backup/firefox-backup.sh
2022-03-14 21:45:57 +01:00

20 lines
442 B
Bash

#!/usr/bin/env bash
source "$(dirname "$0")/variables.conf"
# Remove old archive
old="$backups_directory/profile-$(date -d "-10 days" +'%Y%m%d').tgz"
if [[ -f $old ]]; then
rm $old
echo "Removed $old"
else
echo "No old archive to remove."
fi
# Save profile
if [[ ! -f "$backups_directory/profile-$(date +'%Y%m%d').tgz" ]]; then
tar zcf "$backups_directory/profile-$(date +'%Y%m%d').tgz" $firefox_data_path/$profile_name
fi
exit 0