firefox-backup/firefox-backup.sh

21 lines
486 B
Bash
Executable File

#!/usr/bin/env bash
run_directory=$(dirname $(readlink -f "$0"))
source "$run_directory/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