firefox-backup/firefox-backup.sh

21 lines
486 B
Bash
Raw Normal View History

2022-03-14 21:45:57 +01:00
#!/usr/bin/env bash
2022-09-22 18:52:25 +02:00
run_directory=$(dirname $(readlink -f "$0"))
source "$run_directory/variables.conf"
2022-03-14 21:45:57 +01:00
# 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