Clean up bash issues with missing files.

This commit is contained in:
Timothy Allen 2020-04-24 20:15:57 +02:00
parent 7ac52b9ea1
commit cb6472a980

View File

@ -24,9 +24,9 @@ if [ -x ~/bin/firefox_tabgroups_export.py ]; then
do_copy=0 do_copy=0
mkdir -p ${backups}/tabs mkdir -p ${backups}/tabs
mkdir -p ${backups}/tabs/sessionstore mkdir -p ${backups}/tabs/sessionstore
previous=$( ls ${backups}/tabs/firefox_tabs.* | tail -1 ) previous=$( ls ${backups}/tabs/firefox_tabs.* 2>/dev/null | tail -1 )
~/bin/firefox_tabgroups_export.py > ${backups}/tabs/firefox_tabs.${epoch} ~/bin/firefox_tabgroups_export.py > ${backups}/tabs/firefox_tabs.${epoch}
if [ -f ${previous} ]; then if [ -f "${previous}" ]; then
if diff -q ${previous} ${backups}/tabs/firefox_tabs.${epoch} >/dev/null; then if diff -q ${previous} ${backups}/tabs/firefox_tabs.${epoch} >/dev/null; then
# No difference, remove this file # No difference, remove this file
if [ ${previous} != ${backups}/tabs/firefox_tabs.${epoch} ]; then if [ ${previous} != ${backups}/tabs/firefox_tabs.${epoch} ]; then
@ -56,7 +56,7 @@ if [ -x ~/bin/firefox_decrypt.py ]; then
mkdir -p ${backups}/passwords mkdir -p ${backups}/passwords
previous=$( ls ${backups}/passwords/firefox_passwords.* | tail -1 ) previous=$( ls ${backups}/passwords/firefox_passwords.* | tail -1 )
echo '' | ~/bin/firefox_decrypt.py > ${backups}/passwords/firefox_passwords.${epoch} 2>/dev/null echo '' | ~/bin/firefox_decrypt.py > ${backups}/passwords/firefox_passwords.${epoch} 2>/dev/null
if [ -f ${previous} ]; then if [ -f "${previous}" ]; then
if diff -q ${previous} ${backups}/passwords/firefox_passwords.${epoch} >/dev/null; then if diff -q ${previous} ${backups}/passwords/firefox_passwords.${epoch} >/dev/null; then
# No difference, remove this file # No difference, remove this file
if [ ${previous} != ${backups}/passwords/firefox_passwords.${epoch} ]; then if [ ${previous} != ${backups}/passwords/firefox_passwords.${epoch} ]; then