changeset 319:7c460a921709

making changes to remote backup scripts to create directory
author aldrich@ssdt-ohio.org
date Thu, 31 Oct 2019 11:40:53 +0100
parents c61524abdfd6
children 58c49a386a11
files scripts/remote-backup-all.sh scripts/remote-backup.sh
diffstat 2 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/remote-backup-all.sh	Wed Oct 30 15:49:51 2019 +0100
+++ b/scripts/remote-backup-all.sh	Thu Oct 31 11:40:53 2019 +0100
@@ -96,8 +96,15 @@
 
 echo "completed backup of all files for $project to ${backupFile3}"
 
+#Create remote directory before scp
+host=`echo $userName@$remoteTarget | sed -e 's/:.*//'`
 
-#
+target=`echo $remoteTarget | sed -e 's/.*://'`
+
+ssh $host mkdir -p $target/$project
+
+
+#Create remote directory
 #
 scp ${backupFile1}.gz  ${backupFile2}.gz ${backupFile3} $userName@$remoteTarget/$project
 
--- a/scripts/remote-backup.sh	Wed Oct 30 15:49:51 2019 +0100
+++ b/scripts/remote-backup.sh	Thu Oct 31 11:40:53 2019 +0100
@@ -65,8 +65,15 @@
 
 echo "completed backup of all files for $project to ${backupFile2}"
 
+#Create remote directory before scp
 
-#
+host=`echo $userName@$remoteTarget | sed -e 's/:.*//'`
+
+target=`echo $remoteTarget | sed -e 's/.*://'`
+
+ssh $host mkdir -p $target/$project
+
+#Create remote directory
 #
 scp ${backupFile}.gz  ${backupFile2} $userName@$remoteTarget/$project