Sponsored Content
Top Forums UNIX for Dummies Questions & Answers If then else in with mget command Post 302500982 by Param0073 on Wednesday 2nd of March 2011 06:59:33 AM
Old 03-02-2011
Question If then else in with mget command

Hi Friends,
I need to use if then else logic with the mget command.I need to check if {JOURNAL_CODE}*_1_Audit*.txt exists then download it (using mget)and if not then leave it.Same for the {JOURNAL_CODE}*_2_Audit*.txt file.Can you please tell me how can i achive that?

Code:
sftp -b - "$FTPUSER"@"$FTPHOST"  <<SFTP_END
 cd $FTPDIR
 -mget ${JOURNAL_CODE}*_1_Audit*.txt
 -mget ${JOURNAL_CODE}*_2_Audit*.txt
 exit
SFTP_END

Moderator's Comments:
Mod Comment Please use [code] and [/code] tags when posting code, data or logs etc. to preserve formatting and enhance readability, thanks.

Last edited by zaxxon; 03-02-2011 at 08:20 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

mget (ftp command)

hey, I was wondering if its possible to use a complete path and file name using the mget command example mget /dir1/dir2/dir3/file.ext or get /dir1/dir2/dir3/file.ext because whenever i try its says file not found or permission denied..... but if i do cd dir1 cd dir2 cd dir3 mget... (2 Replies)
Discussion started by: Ganondorf
2 Replies

2. UNIX for Dummies Questions & Answers

mget

hi, i want to mget a directory. how to specify the flag that i dont want the system to prompt me? thanks (2 Replies)
Discussion started by: yls177
2 Replies

3. Shell Programming and Scripting

Is there a limit to mget command?

Hi All, I am using a csh ftp to get all the relevant files i need. When i reduce the number of file to 4 (which is aaa,bbb,ccc,ddd), the script manage to get all the files i need. But when i add "eee" to the mget command, it doesn;t seem to get any files at all. Is there a limit to how many... (0 Replies)
Discussion started by: Raynon
0 Replies

4. Shell Programming and Scripting

mget command

Hi All, I am using mget (mget server.*) through ftp... ... i dont want to overwrite the files in my localmachine if it is already exists... is it possible through ftp ?? any other optios also mos t welcome Thnks in advance (4 Replies)
Discussion started by: scorpio
4 Replies

5. UNIX for Advanced & Expert Users

mget ftp command options

Hi, I am using mget ftp command to pull a bunch of zip files from Windows to local unix machines. It is working fine as follows. -rw------- 1 autosys autosys 614 Aug 19 13:13 02034128.zip -rw------- 1 autosys autosys 1866 Aug 19 13:13 02034127.zip -rw------- 1 autosys autosys 14592 Aug 19... (1 Reply)
Discussion started by: spatra
1 Replies

6. Shell Programming and Scripting

mget ftp command options

Hi, I am using mget ftp command to pull a bunch of zip files from Windows to local unix machines. It is working fine as follows. -rw------- 1 autosys autosys 614 Aug 19 13:13 02034128.zip -rw------- 1 autosys autosys 1866 Aug 19 13:13 02034127.zip -rw------- 1 autosys ... (1 Reply)
Discussion started by: spatra
1 Replies

7. UNIX for Dummies Questions & Answers

mget command issues

Hi I am trying to get 3 files sitting on a FTP server to an application server. All 3 files are .csv files. I am using mget *.csv and it transfers only 2 files. the 3 files contain a common word in their file names "Report". I tried mget *Report*.csv and that gets me 2 files as well. ... (3 Replies)
Discussion started by: bobsn
3 Replies

8. Shell Programming and Scripting

Unix Mget command issue

Hi, I am facing an issue with mget command, below are the details The following commands are in a batch file "abc.ctl" cd /mypath/mydirectory/ mget 'MYFILE_*.touch' bye I use this file as a parameter for an sftp command sftp -b abc.ctl -oIdentityFile=$myserver -oPort=$myport >>... (0 Replies)
Discussion started by: saurabh_mh
0 Replies

9. UNIX for Dummies Questions & Answers

mget help

Hi I'm trying to get all files from a directory with a script. So i'm gone paste my script here: cd /var/www/match_demos/speedgaming/ lftp -u Gudfaren,xxxxx ftp.speedgaming.pro -e cd 89.221.243.11_27500 -e mget *.dem exit when i run that i get: "File name missed. Try `help mget' for more... (2 Replies)
Discussion started by: vYN
2 Replies

10. Shell Programming and Scripting

How to specify more then one pattern in a single mget statement of ftp command?

hi, i am using ftp command to get some files from a remote server. if the remote server contains files of different extension. abc.txt def.txt ghi.lst jkl.cnf is it possible to get all the three type of files in one ftp? i am using this ftp command $FTP $Remote_server <<_FTP1 ... (4 Replies)
Discussion started by: Little
4 Replies
ECACCESS-FILE-MGET(1p)					User Contributed Perl Documentation				    ECACCESS-FILE-MGET(1p)

NAME
ecaccess-file-mget - Download Multiple ECaccess Files at once SYNOPSIS
ecaccess-file-mget -version|-help|-manual ecaccess-file-mget [-debug] [-progress] [-force] [-bufsize length] source-ecaccess-file [...] target-local-directory DESCRIPTION
Allow downloading Multiple ECaccess Files at once in the specified target-local-directory. Each source-ecaccess-file is in the form [domain:][/user-id/]path. Please read the "Shell commands -> File Management" section of the "ecaccess" guide for more information on the ECaccess File System. Please note this command is not recursive and will only download the plain-files in the source-ecaccess-file directory (sub-directories are ignored). ARGUMENTS
source-ecaccess-file [...] The name(s) of the source ECaccess File(s). target-local-directory The name of the target Local Directory. OPTIONS
-progress Provide a progress meter on the standard terminal, allowing to monitor the file transmission in real-time. The progress bar is removed from the terminal when the transmission is done. This option is not supported and ignored on Windows platforms. -force Overrides the interactive mode and download each file without prompting. -bufsize length Specify the length of the buffer (in bytes) which is used to download the files. The larger the buffer the smaller the number of http/s requests. By default a buffer of 1048576 bytes(1MB) is used. -version Display version number and exits. -help Print a brief help message and exits. -manual Prints the manual page and exits. -debug Display the SOAP messages exchanged. EXAMPLES
ecaccess-file-mget 'home:/xyz/bin/*.bin' $HOME/bin Download the *.bin Files in the $HOME/bin directory of the user xyz. The Files are downloaded in the local $HOME/bin directory. SEE ALSO
ecaccess-file-delete, ecaccess-file-get, ecaccess-file-chmod, ecaccess-file-modtime, ecaccess-file-mput, ecaccess-file-rmdir, ecaccess- file-copy, ecaccess-file-dir, ecaccess-file-mdelete, ecaccess-file-mkdir, ecaccess-file-move, ecaccess-file-put, ecaccess-file-size and ecaccess. perl v5.14.2 2012-04-16 ECACCESS-FILE-MGET(1p)
All times are GMT -4. The time now is 07:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy