Automating the FTP get


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Automating the FTP get
# 1  
Old 06-17-2013
Automating the FTP get

Hi ,

I want to pull files from ftp monthly once . The files in ftp has a something like 292_fileto_pull and next month it will be 293_fileto_pull for each month the number keeps increasing. i thought in my script if i can use date and increment the number by it

mget *_292_fileto_pull

i want to change the 292 value every time automatically when i run the script

Any help would be Thankfull
# 2  
Old 06-17-2013
add a block like the following to the start of the run to keep track of the counter in a file.
Code:
$next=$(( $(cat .last_run) + 1 ))
echo $next >> .last_run

This User Gave Thanks to Skrynesaver For This Post:
# 3  
Old 06-19-2013
Hi Skrynesaver ,

srry for late reply i didnt get a chance to work on this after posting the thread the above code you provided works fine for me


Thank you!!

Last edited by vikatakavi; 06-19-2013 at 03:38 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Automating

Hi All, I have a shell script that is integrated with a fault management system. It periodically monitors the system and raises an alarm. This script has different functions and it accepts input from us on the console. Is there any way to invoke it using a shell script ? Please advise. ... (2 Replies)
Discussion started by: praviper
2 Replies

2. UNIX for Dummies Questions & Answers

Automating a process

Could any one tell me , how to start a thread here, i just searching for so long. sorry to post in irrelavent here ---------- Post updated at 08:19 AM ---------- Previous update was at 08:00 AM ---------- Hi, I got a requirement to automate the process. We have SLA files, there are... (1 Reply)
Discussion started by: afahmed
1 Replies

3. Shell Programming and Scripting

Automating The process

Hi Guru's, I am trying to write a scripts that will automate my image provisoining process. Scenario: I have Linux Image Hosted on cloud which needs to be provisoned before it can be used. Currently we log onto the image through the putty on windows and connect to linux instance. I... (3 Replies)
Discussion started by: taqvia
3 Replies

4. UNIX for Dummies Questions & Answers

Automating ftp job using implicit ssl?

Can this be done? Or do you need some other program installed on the AIX box? (6 Replies)
Discussion started by: NycUnxer
6 Replies

5. Shell Programming and Scripting

Automating ftp without .netrc

I'm writing a script which needs to run under an 'automation' account and there is already a .netrc machine definition for the server I need to connect to. If I create a new machine entry in the .netrc with a different account this will, of course, be ignored and the ftp session will connect to... (3 Replies)
Discussion started by: DeepakS
3 Replies

6. Shell Programming and Scripting

Automating slapconfig

I'm a New Media student working at a small media/tech company that's part of the New Media department at my school. I'm working on a MySQL/LDAP-based system for keeping track of users of our Mac file server. I'm trying to write a script that backs up our LDAP database using the slapconfig command... (0 Replies)
Discussion started by: ZevEisenberg
0 Replies

7. UNIX for Advanced & Expert Users

displaying error while automating ftp

#!/bin/sh HOST=HOST_IP USER=$USER PASSWD=$PASSWD FILE="*.htm" ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD get $FILE quit END_SCRIPT exit 0 Is there any way to display appropriate error message if the file is not found on the server...... (2 Replies)
Discussion started by: bishweshwar
2 Replies

8. Shell Programming and Scripting

Automating telnet and ftp

Hi, I want to automate FTP. I have a fair idea that this can be done using expect scripting. But I dont how to do it. Please, can anyone give me an example of how to do it in Unix. Thanks in advance (2 Replies)
Discussion started by: sendhilmani123
2 Replies

9. Shell Programming and Scripting

Automating sendmail

Hi there, I am trying to send emails from within a shell script, and I need help. Also I am trying to send attachments from within a shell script. I am using sendmail. Regards (3 Replies)
Discussion started by: JimJim
3 Replies
Login or Register to Ask a Question