To automate a process


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers To automate a process
# 1  
Old 12-22-2010
Java To automate a process

CAN ANYONE HELP TO SOLVE

i wann write a script to automate a process .i.e, to search files in the FTP server and
and if files are there and we hav to bring that files to our system.
After copying the files in our system we have to upload the data in the tables.

I have scripts to load the data into tables and to copy files from ftp to our system.

we use to run the scripts every day....

This whole process has to be automated.
tat means.... the script has to check evryday for the files in the FTP and if file is
present in the FTP it automatically brings the file into our system and it has to load the
data into tables.....
I had six scripts... we hav to automate this scripts one by one.....
Can anyone please help in this issue....

Thanks,
Nani

Last edited by Scott; 12-22-2010 at 02:24 PM.. Reason: Thread moved
# 2  
Old 12-22-2010
Break it down into pieces, work up from smallest pieces to the loop that does all:
Code:
mkdir /tmp/dload.$$
scp2 +C id@host:file_path* /tmp/dload.$$
ls /tmp/dload.$$/*|while read f
do
 my_loader $f
done
rm -rf /tmp/dload.$$

You write my_loader so it knows how to a) load each file to any or all applicable tables using table-specific scripts, and b) move the file to your archive directory, compressed. Tool scp2 is much more secure than ftp, has passwordless authentication and can compress +C during network transit.
# 3  
Old 12-29-2010
If the target system does not support SSH, add an entry for the remote system in your .netrc file. You can then do something like:
Code:
echo get file | ftp -p hostname

in your gather script.

Last edited by m.d.ludwig; 12-29-2010 at 04:41 PM.. Reason: typo
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to automate recovery process

Hello All! First post... I am working on a script that is used to recover a crashed drive from an rsync backup. I'm down to the place where I need to create all of the directories in /mnt where I will then mount each of the volumes and begin the restore process to each volume... I have... (3 Replies)
Discussion started by: RogerBaran
3 Replies

2. UNIX for Dummies Questions & Answers

Automate sftp process using script

Hi, guys, I am trying to automate a sftp process using "expect" method (since the key authentication method is disabled in my company network, there is no helping it). In order to try, I type in the command manually: sftp @ > << EOF >cd >ls -l >EOF >Connecting to @servername password: ... (3 Replies)
Discussion started by: warmboy610
3 Replies

3. Shell Programming and Scripting

Need help in creating a shell script to automate svnstats process

Hi, I am trying to create a shell script to automate the following process of getting svn stats:- Step1:- cd to checkout location. Note that the checked code have multiple modules in respective folders Step2:- Execute this command inside each module:- svn log -v --xml >... (0 Replies)
Discussion started by: d8011
0 Replies

4. Shell Programming and Scripting

Automate the process of running jobs on several directories consecutively

Hi, I have about 10 directories in which I run the same code. But this code is only run in a directory when the computation in the previous directory was successful (explained below). My directories are named as : VF_50, VF_100, VF_150, VF_200............. As you can see the number after _... (6 Replies)
Discussion started by: lost.identity
6 Replies

5. UNIX for Advanced & Expert Users

TO Automate the FTP process

Plzz Some One Help in this matter I have scripts to load the data into tables and to copy files from ftp to our system. we use to run the scripts every day.... we hav the files in the FTP server and we hav to bring the files to our system and we hav to load the data into the tables. We... (0 Replies)
Discussion started by: nani1984
0 Replies

6. Shell Programming and Scripting

To automate a process

CAN ANYONE HELP TO SOLVE i wann write a script to automate a process .i.e, to search files in the FTP server and and if files are there and we hav to bring that files to our system. After copying the files in our system we have to upload the data in the tables. I have scripts to load the... (0 Replies)
Discussion started by: nani1984
0 Replies

7. Shell Programming and Scripting

Automate Log Monitoring Process

I am a new member of this forum and am also new to unix shell scripting. I joined the forum to seek for help to achieve my task as this forum helps people. here's what i do manually on daily basis 1)Loginto different unix box 2)Ftp the log files (morethan 50 each dir) to windows 3)use text pad... (3 Replies)
Discussion started by: sharugan
3 Replies

8. Shell Programming and Scripting

PLEASE PLEASE Help - Automate text manipulation process

I am trying to automate a process (on windows OS) of manipulating a file by changing its column delimiters. I have a perl script ready but the problem i think is with the format of the file itself. code: #! usr/bin/perl -w foreach (<STDIN>) { #copy this line: my $line = $_; ... (1 Reply)
Discussion started by: salemh
1 Replies

9. IP Networking

Automate FTP process and autorestart on link failure

Hi Guys, i have this lil challenge; i am to implement an automated script that searches/scans a directory for files then picks and sends this files to a very remote server via an ftp link. the challenge here is that the ftp link fails due to netwrk issues maybe; i therefore need to develop... (5 Replies)
Discussion started by: sdcoms
5 Replies

10. Shell Programming and Scripting

How to automate an FTP process?

Hello script experts, I am newbie to shell script. But I have to write a shell script (ASAP) where I need to ftp a file on daily basis to a remote server, and send an email with final status. I I should have a properties file with hostname, Userid, and pwd. And a shall script file should read... (1 Reply)
Discussion started by: ksak
1 Replies
Login or Register to Ask a Question