-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtransfer.sh
More file actions
18 lines (17 loc) · 733 Bytes
/
transfer.sh
File metadata and controls
18 lines (17 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
# 02/20/2020
# Script to transfer files from DMZ to Secure Zone.
# The default setting is all files associated with a <file>.hash value; this signifies a tar file is ready to be transferred.
cd /var/www/html/repo/
for f in *; do
if [ -f "$f" ]; then
if [[ "$f" == *".hash" ]]; then
echo "Found: $f.hash"
echo "Starting Transfer of tar files for $f."
transfer="${f%.hash}".tar.gz
# SCP used to allow for transfer to a Samba share or Windows IIS server.
sshpass -f "/root/xfer" scp -r $transfer transfers@YU:/var/www/html/repo/$transfer
fi
fi
done
sshpass -f "/root/xfer" scp -r /var/www/html/repo/local.new transfers@YU:/var/www/html/repo/local.new