Permalink
Browse files

Log file size of NEMS Migrator backups

  • Loading branch information...
NEMS Linux
NEMS Linux committed Jan 4, 2019
1 parent 45587cc commit 2b116b247de2445187cd0a23c1338b2c2280ca9b
Showing with 8 additions and 3 deletions.
  1. +8 −3 backup.sh
@@ -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

@@ -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

0 comments on commit 2b116b2

Please sign in to comment.