20 lines
442 B
Bash
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
|