Difference between revisions of "Download backup file from remote and copy to Synology"

From rbachwiki
Jump to navigation Jump to search
(Created page with "<h4> NOTE: File must already exist and you must know the exact filename that is being downloaded</h4> <h4 class="yellowbackground">opidwnlfromremotetolocal.sh</h4> <pre> #!/bin/bash d=`date +%Y%m%d` n="opilocal-" e=".jpa" name=$n$d$e #dest='/volume1/Linode/' scp -i ~/.ssh/linode 173.255.229.40:/var/www/html/opilocal/akbackup/$name . echo "+++++++++ done copying form Remoge ++++++++++++++++++" sleep 3 scp -i ~/.ssh/synology $name admin@192.168.20.120:/volume1/Linode/op...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<h4> NOTE: File must already exist and you must know the exact filename that is being downloaded</h4>
<h4> NOTE: File must already exist and you must know the exact filename that is being downloaded</h4>
<h4 class="yellowbackground">opidwnlfromremotetolocal.sh</h4>
<h4 class="bluebackground">opidwnlfromremotetolocal.sh</h4>
<pre>
<pre>
#!/bin/bash
#!/bin/bash
Line 8: Line 8:
name=$n$d$e
name=$n$d$e
#dest='/volume1/Linode/'
#dest='/volume1/Linode/'
scp -i ~/.ssh/linode  173.255.229.40:/var/www/html/opilocal/akbackup/$name .
scp -i ~/.ssh/linode  10.1.0.1:/var/www/html/opi/akbackup/$name .


echo "+++++++++ done copying form Remoge ++++++++++++++++++"
echo "+++++++++ done copying form Remote ++++++++++++++++++"
sleep 3
sleep 3


scp -i ~/.ssh/synology $name admin@192.168.20.120:/volume1/Linode/opilocal
scp -i ~/.ssh/synology $name admin@192.168.2.10:/volume1/Linode/opilocal


echo " +++++++++++++++++++++++++ Done copying to stan ++++++++++++++ "
echo " +++++++++++++++++++++++++ Done copying to stan ++++++++++++++ "
ssh -i ~/.ssh/synology admin@192.168.20.120 "cd /volume1/Linode/opilocal;ls -la"
ssh -i ~/.ssh/synology admin@192.168.2.10 "cd /volume1/Linode/opilocal;ls -la"


sleep 5
sleep 5
Line 23: Line 23:
echo " +++++++++++ Deleting jpa file +++++++++++++++"
echo " +++++++++++ Deleting jpa file +++++++++++++++"
</pre>
</pre>
==[[Main_Page| Home]] - [[Scripts_used_on_Servers|Category]]==
[[Category:Bash]]

Latest revision as of 14:52, 15 June 2023

NOTE: File must already exist and you must know the exact filename that is being downloaded

opidwnlfromremotetolocal.sh

#!/bin/bash
d=`date +%Y%m%d`
n="opilocal-"
e=".jpa"
name=$n$d$e
#dest='/volume1/Linode/'
scp -i ~/.ssh/linode  10.1.0.1:/var/www/html/opi/akbackup/$name .

echo "+++++++++ done copying form Remote ++++++++++++++++++"
sleep 3

scp -i ~/.ssh/synology $name admin@192.168.2.10:/volume1/Linode/opilocal

echo " +++++++++++++++++++++++++ Done copying to stan ++++++++++++++ "
ssh -i ~/.ssh/synology admin@192.168.2.10 "cd /volume1/Linode/opilocal;ls -la"

sleep 5
rm *.jpa

echo " +++++++++++ Deleting jpa file +++++++++++++++"

Home - Category