-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGet_i_PTF.sh
40 lines (34 loc) · 1.05 KB
/
Get_i_PTF.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/QOpenSys/pkgs/bin/bash
# Bryan Dietz 06/23/2023
# *** work in progress***
# for now install in directory /ptfs
# make sure rpm pile is install plus "lftp"
#
# use the first email from IBM for the first 4 "parms"
# and the last email wit hthe PWD for the given sftp user
#
# i used the "mirror" option in lftp so I could have a couple of concurrent
# downloads. adjust as necessary
echo "sFTP User Name: "
read s_user
echo "Remote Server: "
read rmt_srv
echo "Remote Directory: "
read rmt_dir
echo "Local Directory: "
read lcl_dir
echo "User Password: "
read u_pwd
echo "-----------------"
echo "sFTP User Name : ${s_user}"
echo "Remote Server : ${rmt_srv}"
echo "Remote Directory: ${rmt_dir}"
echo "Local Directory : ${lcl_dir}"
echo "User Password : ${u_pwd}"
echo "-----------------"
/QOpenSys/pkgs/bin/lftp -c "set sftp:auto-confirm on; set xfer:clobber on; \
set xfer:log-file /ptfs/my_lftp.log; \
open -u $s_user,$u_pwd \
sftp://$rmt_srv;lcd $lcl_dir;\
cd $rmt_dir;ls;mirror --verbose --use-pget-n=2 -c --verbose . $lcl_dir"
ls -la $lcl_dir