Download backup file from remote and copy to Synology

From rbachwiki
Revision as of 14:52, 15 June 2023 by Bacchas (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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