updated script for new paths

This commit is contained in:
2023-08-26 17:24:00 -05:00
parent 68c6b13d4b
commit e1bf51a674
2 changed files with 13 additions and 14 deletions

View File

@@ -6,46 +6,46 @@ if ping -c 1 192.168.1.41 &> /dev/null
ssh proxyserver "crontab -l | tee /home/akanealw/scripts/crontab.bak > /dev/null 2>&1 \
&& sudo crontab -l | sudo tee /root/scripts/crontab.bak > /dev/null 2>&1 \
&& rm /home/akanealw/scripts/debian-essentials.sh > /dev/null 2>&1 \
&& rsync -azvP /home/akanealw/scripts/ akanealw@fileserver:/home/akanealw/gitrepos/fileserver/files/bashscripts/proxyserver/akanealw/ \
&& rsync -azvP /home/akanealw/scripts/olivetin/ akanealw@fileserver:/home/akanealw/gitrepos/fileserver/files/bashscripts/proxyserver/akanealw/olivetin/ \
&& sudo rsync -azvP /root/scripts/ akanealw@fileserver:/home/akanealw/gitrepos/fileserver/files/bashscripts/proxyserver/root/"
&& rsync -azvP /home/akanealw/scripts/ akanealw@fileserver:/home/akanealw/gitrepos/scripts/linux/proxyserver/akanealw/ \
&& rsync -azvP /home/akanealw/scripts/olivetin/ akanealw@fileserver:/home/akanealw/gitrepos/scripts/linux/proxyserver/akanealw/olivetin/ \
&& sudo rsync -azvP /root/scripts/ akanealw@fileserver:/home/akanealw/gitrepos/scripts/linux/proxyserver/root/"
# dockerserver
ssh dockerserver "crontab -l | tee /home/akanealw/scripts/crontab.bak > /dev/null 2>&1 \
&& sudo crontab -l | sudo tee /root/scripts/crontab.bak > /dev/null 2>&1 \
&& rm /home/akanealw/scripts/debian-essentials.sh > /dev/null 2>&1 \
&& rsync -azvPH /home/akanealw/scripts/ akanealw@fileserver:/home/akanealw/gitrepos/fileserver/files/bashscripts/dockerserver/akanealw/ \
&& sudo rsync -azvP /root/scripts/ akanealw@fileserver:/home/akanealw/gitrepos/fileserver/files/bashscripts/dockerserver/root/"
&& rsync -azvPH /home/akanealw/scripts/ akanealw@fileserver:/home/akanealw/gitrepos/scripts/linux/dockerserver/akanealw/ \
&& sudo rsync -azvP /root/scripts/ akanealw@fileserver:/home/akanealw/gitrepos/scripts/linux/dockerserver/root/"
# plexserver
ssh plexserver "crontab -l | tee /home/akanealw/scripts/crontab.bak > /dev/null 2>&1 \
&& sudo crontab -l | sudo tee /root/scripts/crontab.bak > /dev/null 2>&1 \
&& rm /home/akanealw/scripts/debian-essentials.sh > /dev/null 2>&1 \
&& rsync -azvP /home/akanealw/scripts/ akanealw@fileserver:/home/akanealw/gitrepos/fileserver/files/bashscripts/plexserver/akanealw/ \
&& sudo rsync -azvP /root/scripts/ akanealw@fileserver:/home/akanealw/gitrepos/fileserver/files/bashscripts/plexserver/root/"
&& rsync -azvP /home/akanealw/scripts/ akanealw@fileserver:/home/akanealw/gitrepos/scripts/linux/plexserver/akanealw/ \
&& sudo rsync -azvP /root/scripts/ akanealw@fileserver:/home/akanealw/gitrepos/scripts/linux/plexserver/root/"
# proxmox1
ssh proxmox1 "crontab -l | tee /home/akanealw/scripts/crontab.bak > /dev/null 2>&1 \
&& sudo crontab -l | sudo tee /root/scripts/crontab.bak > /dev/null 2>&1 \
&& rm /home/akanealw/scripts/debian-essentials.sh > /dev/null 2>&1 \
&& rm /root/scripts/proxmox* > /dev/null 2>&1 \
&& rsync -azvP /home/akanealw/scripts/ akanealw@fileserver:/home/akanealw/gitrepos/fileserver/files/bashscripts/proxmox1/akanealw/ \
&& sudo rsync -azvP /root/scripts/ akanealw@fileserver:/home/akanealw/gitrepos/fileserver/files/bashscripts/proxmox1/root/"
&& rsync -azvP /home/akanealw/scripts/ akanealw@fileserver:/home/akanealw/gitrepos/scripts/linux/proxmox1/akanealw/ \
&& sudo rsync -azvP /root/scripts/ akanealw@fileserver:/home/akanealw/gitrepos/scripts/linux/proxmox1/root/"
# proxmox2
ssh proxmox2 "crontab -l | tee /home/akanealw/scripts/crontab.bak > /dev/null 2>&1 \
&& sudo crontab -l | sudo tee /root/scripts/crontab.bak > /dev/null 2>&1 \
&& rm /home/akanealw/scripts/debian-essentials.sh > /dev/null 2>&1 \
&& rm /root/scripts/proxmox* > /dev/null 2>&1 \
&& rsync -azvP /home/akanealw/scripts/ akanealw@fileserver:/home/akanealw/gitrepos/fileserver/files/bashscripts/proxmox2/akanealw/ \
&& sudo rsync -azvP /root/scripts/ akanealw@fileserver:/home/akanealw/gitrepos/fileserver/files/bashscripts/proxmox2/root/"
&& rsync -azvP /home/akanealw/scripts/ akanealw@fileserver:/home/akanealw/gitrepos/scripts/linux/proxmox2/akanealw/ \
&& sudo rsync -azvP /root/scripts/ akanealw@fileserver:/home/akanealw/gitrepos/scripts/linux/proxmox2/root/"
# fileserver
crontab -l | tee /home/akanealw/scripts/crontab.bak > /dev/null 2>&1
sudo crontab -l | sudo tee /root/scripts/crontab.bak > /dev/null 2>&1
rm /home/akanealw/scripts/debian-essentials.sh > /dev/null 2>&1
rsync -azvP /home/akanealw/scripts/ /home/akanealw/gitrepos/fileserver/files/bashscripts/fileserver/akanealw/
sudo rsync -azvP /root/scripts/ /home/akanealw/gitrepos/fileserver/files/bashscripts/fileserver/root/
rsync -azvP /home/akanealw/scripts/ /home/akanealw/gitrepos/scripts/linux/fileserver/akanealw/
sudo rsync -azvP /root/scripts/ /home/akanealw/gitrepos/scripts/linux/fileserver/root/
# chown all files copied
sudo chown -R akanealw:akanealw /home/akanealw/gitrepos/fileserver/files/

View File

@@ -21,4 +21,3 @@
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
0 13 * * * /home/akanealw/scripts/backup-scripts-to-gitrepo.sh