Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/emoncms/backup
Browse files Browse the repository at this point in the history
  • Loading branch information
glynhudson committed Jun 22, 2018
2 parents 9ec2a1c + f985c0a commit 59cf066
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions emoncms-export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ then
sudo rm $backup_location/emoncms-backup-$date.tar
fi


#-----------------------------------------------------------------------------------------------
# Check emonPi / emonBase image version
#-----------------------------------------------------------------------------------------------
Expand All @@ -57,8 +56,6 @@ else
fi
#-----------------------------------------------------------------------------------------------



sudo service feedwriter stop

# Get MYSQL authentication details from settings.php
Expand All @@ -78,6 +75,7 @@ if [ -n "$username" ]; then # if username string is not empty
if [ $? -ne 0 ]; then
echo "Error: failed to export mysql data"
echo "emoncms export failed"
sudo service feedwriter start > /dev/null
exit 1
fi

Expand All @@ -96,6 +94,7 @@ if [ $image="old" ]; then
if [ $? -ne 0 ]; then
echo "Error: failed to tar config data"
echo "emoncms export failed"
sudo service feedwriter start > /dev/null
exit 1
fi
fi
Expand All @@ -107,6 +106,7 @@ if [ $image="new" ]; then
if [ $? -ne 0 ]; then
echo "Error: failed to tar config data"
echo "emoncms export failed"
sudo service feedwriter start > /dev/null
exit 1
fi
fi
Expand All @@ -116,6 +116,7 @@ tar --append --file=$backup_location/emoncms-backup-$date.tar -C $mysql_path php
if [ $? -ne 0 ]; then
echo "Error: failed to tar mysql dump and data"
echo "emoncms export failed"
sudo service feedwriter start > /dev/null
exit 1
fi

Expand All @@ -125,6 +126,7 @@ gzip -fv $backup_location/emoncms-backup-$date.tar 2>&1
if [ $? -ne 0 ]; then
echo "Error: failed to compress tar file"
echo "emoncms export failed"
sudo service feedwriter start > /dev/null
exit 1
fi

Expand Down

0 comments on commit 59cf066

Please sign in to comment.