Skip to content

Commit

Permalink
Log file size of NEMS Migrator backups
Browse files Browse the repository at this point in the history
  • Loading branch information
NEMS Linux committed Jan 4, 2019
1 parent 45587cc commit 2b116b2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ else

# Create the archive containing sensitive information
privfile='/tmp/private.tar.gz'
tar --ignore-failed-read -czf $privfile \
printf " "
tar --warning=no-file-changed --ignore-failed-read -czf $privfile \
$mainpriv \
$addprivate

Expand All @@ -124,19 +125,23 @@ else


# Create the generic backup (not particularly sensitive)
tar --ignore-failed-read -cf - \
printf " "
tar --warning=no-file-changed --ignore-failed-read -cf - \
$privfile \
$mainpub \
$addpublic | /bin/gzip --no-name > /tmp/backup.nems

# Log the file size
FILESIZE=$(stat -c%s "/tmp/backup.nems")
echo $FILESIZE > /var/www/html/backup/snapshot/size.log

# systemctl start $nagios

rm $privfile

mv /tmp/backup.nems /var/www/html/backup/snapshot/backup.nems

echo "Done. You'll find the backup at /var/www/html/backup/snapshot/backup.nems"

echo ""
echo You can access the file from your computer by navigating to
echo https://NEMS.local/backup/ -or- \\\\NEMS.local\\backup
Expand Down

0 comments on commit 2b116b2

Please sign in to comment.