This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
computing:remote-upgrades [2020/01/21 05:01] – oemb1905 | computing:remote-upgrades [2020/01/27 20:36] – oemb1905 | ||
---|---|---|---|
Line 47: | Line 47: | ||
username ALL=(root) NOPASSWD: / | username ALL=(root) NOPASSWD: / | ||
| | ||
- | Now you are ready to create the script on the primary workstation that will pass the apt-remote script to the target workstations: | + | Now you are ready to create the script on the primary workstation |
sudo touch / | sudo touch / | ||
Line 56: | Line 56: | ||
In the file that opens, use the following script parameters or something similar. | In the file that opens, use the following script parameters or something similar. | ||
| | ||
- | hostsa="haackremote.mooo.com lthsf.mooo.com" | + | # |
- | #run on each host | + | hosts="server.com 10.55.55.9" |
- | for i in $hostsa; | + | |
- | do | + | |
- | echo "I will now update" | + | |
- | ssh -t -p 60000 $i sudo apt-remote; | + | |
- | done; | + | |
- | And here is how I adjusted the primary workstation script to do this with a remote | + | #run on each host |
+ | |||
+ | for i in $hosts; | ||
- | #!/bin/bash | ||
- | cd / | ||
- | sudo openvpn hostname.mooo.com.ovpn & | ||
- | sleep 10s | ||
- | hostsa=" | ||
- | for i in $hostsa; | ||
do | do | ||
+ | |||
echo "I will now update" | echo "I will now update" | ||
- | ssh -t -p 59999 targetuser@$i sudo apt-remote; | + | |
+ | ssh -t $i screen -S aptremotescreen | ||
done; | done; | ||
- | cd ~ | ||
- | sudo killall openvpn | ||
- | sleep 10s | ||
- | These configs an be found on the haackingclub gitlab repository over here: | ||
- | * [[https://codetalkers.services/ | + | If you would prefer to do these types of backups with a vpn connection (instead of port forwarding), |
+ | |||
+ | Option 1 - Using vpn connection, connect from localhost to remote host/server with ssh and screen, and then execute a script on the server that uses rsync over ssh to send its backup to target backup host on its LAN: | ||
+ | |||
+ | Use this script on your localhost: | ||
+ | Use this script on the remote host that you are backing up: [[https:// | ||
+ | |||
+ | Option 2 - Using vpn connection, connect from localhost to remote host/server with ssh and screen, and then execute a script on the server that uses rsync over ssh to send its backup back to you at localhost: | ||
+ | |||
+ | Use this script on your localhost: [[https:// | ||
| | ||
- | --- // | + | --- // |