creating loop within ftp session for fetching data
Code:
echo "which stations you want to download (example input, brmu ankr) ? : " stations=ankr brmu year=2013 2014 doy=001 002 w.r.t. these inputs I need to create loop like; Code:
cd 2013;cd 001;mget *;cd .. |
seems like scp/sftp/sshfs would be safer and easier ?
|
Is there any example related this issue in scp/sftp/sshfs?
|
Code:
scp user1@host1:/whatever/floats/your/boat user2@host2:/whatever/grinds/your/gears |
Assuming you have can login to the server via ssh then schneidz method would be easier since the command to get the files would be
dir1=/../$year/$day (etc...) dir2=... scp user@host:/$dir1/ . (The . means to transfer the files to the current working directory.) scp user@host:/$dir2/ . Additional code would be required to parse for year intervals and knowing the absolute path to the ftp directories. However, since you are logging in as anonymous then maybe not. Once you are logged in via ftp you are limited to using its command set. Just brainstorming one way would be to create your loop outside the herdoc (i.e. everything enclosed by <<end_script end_script) and run it over the year interval or whatever. Create a variable for each directory as above and then Code:
foreach year do (just psuedo code) |
All times are GMT -5. The time now is 08:13 PM. |