User Tools

Site Tools


my_backup_pi_scripts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
my_backup_pi_scripts [2016/11/06 17:51] walkeradminmy_backup_pi_scripts [2016/11/06 18:36] walkeradmin
Line 11: Line 11:
 \\  \\ 
 \\  \\ 
-===== Webserver1 Script (wevsvr1backup) Latest =====+===== Webserver1 Script (wikibackup) Latest =====
 <file> <file>
 #!/bin/bash #!/bin/bash
Line 18: Line 18:
 # #
 # #
-# Alan Walker - Aug 2016+# Alan Walker - Nov 2016
 # #
 # #
Line 32: Line 32:
 # make a folder with the current date # make a folder with the current date
 mkdir /home/pi/Backups/webserver1/$(date '+%Y-%m-%d') mkdir /home/pi/Backups/webserver1/$(date '+%Y-%m-%d')
-# 
 # #
 # copy files from cpg15x on webserver to this server # copy files from cpg15x on webserver to this server
 echo "Copying cpg15x files to /mnt/usbstorage/backups/webserver1/"$(date '+%Y-%m-%d') echo "Copying cpg15x files to /mnt/usbstorage/backups/webserver1/"$(date '+%Y-%m-%d')
-sudo sshpass -p "Cr00kh0rn52.." rsync --verbose --recursive --perms --executability --acls --xattrs --owner --group  pi@192.168.1.9:/mnt/usbhdd/cpg15x /home/pi/Backups/webserver1/$(date '+%Y-%m-%d') +sudo sshpass -p "Password" rsync --verbose --recursive --perms --executability --acls --xattrs --owner --group  pi@192.168.1.9:/mnt/usbhdd/cpg15x /home/pi/Backups/webserver1/$(date '+%Y-%m-%d')
-#+
 # #
 # copy files from ShotLive on webserver to this server # copy files from ShotLive on webserver to this server
 echo "Copying ShotLive files to /mnt/usbstorage/backups/webserver1/"$(date '+%Y-%m-%d') echo "Copying ShotLive files to /mnt/usbstorage/backups/webserver1/"$(date '+%Y-%m-%d')
 #sudo rsync --verbose --recursive --perms --executability --acls --xattrs --owner --group  pi@192.168.1.10:/home/pi/ShotLive /mnt/usbstorage/backups/webserver1/$(date '+%Y-%m-%d') #sudo rsync --verbose --recursive --perms --executability --acls --xattrs --owner --group  pi@192.168.1.10:/home/pi/ShotLive /mnt/usbstorage/backups/webserver1/$(date '+%Y-%m-%d')
-sudo sshpass -p "Cr00kh0rn52.." rsync --verbose --recursive --perms --executability --acls --xattrs --owner --group  pi@192.168.1.9:/mnt/usbhdd/ShotLive /home/pi/Backups/webserver1/$(date '+%Y-%m-%d') +sudo sshpass -p "Password" rsync --verbose --recursive --perms --executability --acls --xattrs --owner --group  pi@192.168.1.9:/mnt/usbhdd/ShotLive /home/pi/Backups/webserver1/$(date '+%Y-%m-%d')
-#+
 # #
 # Backup MySQL Database (the one database is used for both ShotLive and Cameraangle) # Backup MySQL Database (the one database is used for both ShotLive and Cameraangle)
 echo "Backup database to /mnt/usbstorage/backups/webserver1/"$(date '+%Y-%m-%d') echo "Backup database to /mnt/usbstorage/backups/webserver1/"$(date '+%Y-%m-%d')
-sudo mysqldump --host 192.168.1.9 -P 3306 -u walkeradmin -pCr00kh0rn52.. alan_gallery > /home/pi/Backups/webserver1/$(date '+%Y-%m-%d')/alan_gallery.sql +sudo mysqldump --host 192.168.1.9 -P 3306 -u username -pPassword alan_gallery > /home/pi/Backups/webserver1/$(date '+%Y-%m-%d')/alan_gallery.sql
-+
-#mysqldump --host 192.168.1.9 -P 3306 -u username -pPassword alan_gallery > /mnt/usbstorage/backups/webserver1/$(date '+%Y-%m-%d')/alan_gallery.sql +
 # #
 # #
Line 55: Line 50:
 echo "Finished" echo "Finished"
 </file> </file>
-\\  
-\\  
-===== Webserver1 Script (wevsvr1backup) Original ===== 
-    #!/bin/bash 
-    # 
-    # Script to backup webserver pi 
-    # 
-    # 
-    # Alan Walker - Aug 2016 
-    # 
-    # 
-    # stuff this script does 
-    # backup (rsync) cpg15x on webserver1 
-    # backup ShotLive on webserver1 
-    # backup (mysqldump) database on webserver1 
-    # 
-    # 
-    # backup (rsync) cpg15x on webserver1 
-    # create new backup folder 
-    echo "Creating folder /mnt/usbstorage/backups/webserver1/"$(date '+%Y-%m-%d') 
-    # make a folder with the current date 
-    mkdir /mnt/usbstorage/backups/webserver1/$(date '+%Y-%m-%d') 
-    # 
-    # 
-    # copy files from cpg15x on webserver to this server 
-    echo "Copying cpg15x files to /mnt/usbstorage/backups/webserver1/"$(date '+%Y-%m-%d') 
-    rsync -avzh pi@192.168.1.10:/home/pi/cpg15x /mnt/usbstorage/backups/webserver1/$(date '+%Y-%m-%d') 
-    # 
-    # 
-    # copy files from ShotLive on webserver to this server 
-    echo "Copying ShotLive files to /mnt/usbstorage/backups/webserver1/"$(date '+%Y-%m-%d') 
-    rsync -avzh pi@192.168.1.10:/home/pi/ShotLive /mnt/usbstorage/backups/webserver1/$(date '+%Y-%m-%d') 
-    # 
-    # 
-    # Backup MySQL Database (the one database is used for both ShotLive and Cameraangle) 
-    echo "Backup database to /mnt/usbstorage/backups/webserver1/"$(date '+%Y-%m-%d') 
-    mysqldump --host 192.168.1.10 -P 3306 -u Username -pPassword alan_gallery > /mnt/usbstorage/backups/webserver1/$(date '+%Y-%m-%d')/alan_gallery.sql 
-    # 
-    # 
-    echo "" 
-    echo "Finished" 
-     
-     
-    NOTE: The username and password have been removed from the SQL script 
 \\  \\ 
 \\  \\ 
 ===== Wiki Server Backup Script (wikibackup) ===== ===== Wiki Server Backup Script (wikibackup) =====
-    #!/bin/bash +<file> 
-    +#!/bin/bash 
-    # Script to backup wiki pi +
-    +# Script to backup wiki pi 
-    +
-    # Alan Walker - Aug 2016 +
-    +# Alan Walker - Nov 2016 
-    +
-    # stuff this script does +
-    +# stuff this script does 
-    # backup wiki (rsync) on wiki pi +
-    +# backup wiki (rsync) on wiki pi 
-    +
-    # backup (rsync) wiki server +
-    # create new backup folder +# backup (rsync) wiki server 
-    echo "Creating folder /mnt/usbstorage/backups/wiki/"$(date '+%Y-%m-%d'+# create new backup folder 
-    # make a folder with the current date +echo "Creating folder /mnt/usbstorage/backups/wiki/"$(date '+%Y-%m-%d'
-    mkdir /mnt/usbstorage/backups/wiki/$(date '+%Y-%m-%d'+# make a folder with the current date 
-    +mkdir /home/pi/Backups/wiki/$(date '+%Y-%m-%d'
-    # +
-    # copy files from /home/pi/dokuwiki on wiki server to this server +# copy files from /home/pi/dokuwiki on wiki server to this server 
-    echo "Copying dokuwiki files to /mnt/usbstorage/backups/webserver1/"$(date '+%Y-%m-%d'+echo "Copying dokuwiki files to /home/pi/Backups/wiki/"$(date '+%Y-%m-%d'
-    rsync -avzh pi@192.168.1.11:/home/pi/dokuwiki /mnt/usbstorage/backups/wiki/$(date '+%Y-%m-%d'+
-    +
-    +sudo sshpass -p "Password" rsync --super --verbose --recursive --perms --executability --acls --xattrs --owner --group  pi@192.168.1.9:/mnt/usbhdd/dokuwiki /home/pi/Backups/wiki/$(date '+%Y-%m-%d'
-    echo "" +
-    echo "Finished" +
-\\ +echo "" 
 +echo "Finished" 
 + 
 +</file>
 \\  \\ 
 ===== Cron Automation ===== ===== Cron Automation =====
my_backup_pi_scripts.txt · Last modified: 2023/03/09 22:35 by 127.0.0.1