Track Sftp process


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Track Sftp process
# 1  
Old 08-09-2004
Question Track Sftp process

Hi,

I am using sftp in my bash script.
I wanted to know whether if there is any way that we can track whether sftp has been successful or not..

Does sftp return any codes?

Thanks in adv
# 2  
Old 12-07-2005
that is what I am looking for

That is what I am looking for!


did any body have any clue, let me explain more:

We used to "push" files to other servers and we "must" assure that the file FTPed Successfully. To do this we have done FTP output forwarding and we "grep" for the returned coded , mainly "226"..


is that applicable with SFTP? Smilie
# 3  
Old 12-07-2005
I assume that you are looking for any sort of verification. Maybe you could use this?
Code:
sftp -b /path/to/sftp_batch_file user@host | tee -a /some/log/file

Your logfile will have details of whether the file was transferred successfully or not. You can grep for the output in there. This is not tested.
# 4  
Old 12-07-2005
Quote:
Originally Posted by blowtorch
I assume that you are looking for any sort of verification. Maybe you could use this?
Code:
sftp -b /path/to/sftp_batch_file user@host | tee -a /some/log/file

Your logfile will have details of whether the file was transferred successfully or not. You can grep for the output in there. This is not tested.
Thanks for help, I did not test it either.
regardless of the command above, is there any "written in books" return codes that tells what is the ( kind of ) status after we fired sFTP command!?
# 5  
Old 12-07-2005
The use of log files is great if you sit there and watch the job run but, if it run at night and it preceeds other jobs that require it to be successful, a log file is 'not' an answer. What is needed is that the job abort if the sftp (or ftp) is not successful.
# 6  
Old 12-10-2005
Quote:
Originally Posted by BCarlson
What is needed is that the job abort if the sftp (or ftp) is not successful.
This will not tell exactly what was the failure cause (i.e. login failed, disk space is full ...etc), is that true?
# 7  
Old 12-11-2005
Does any body have any Idea? Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Some trace file to track timings of a process

I will initiate a process from Server1 and the flow is as follow Server1 --> Web server --> Application server --> DB Server Note all seperate unix servers. Now I need to put a trace for that process to track the timings from each server. Like the below trace should be there: ... (5 Replies)
Discussion started by: saraperu
5 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

sftp process

Hi, I have written the following bash shell script for Sftp process,I have already configured the OPEN-SSH server settings and the script is working fine , the script moves files from one folder to another folder within the server itself but the issuse is that when it moves the file from one... (1 Reply)
Discussion started by: nks342
1 Replies

4. Shell Programming and Scripting

SFTP Process each File!

Hi All, I'm a newbie here in unix. I'm just wondering how can i process each file while in sftp? is it possible? Ex. server1 1.txt 2.txt how can i get the top of the file and process it. output: 1.txt is going to process because it's in the top. i can't figure out how to do it. T_T... (9 Replies)
Discussion started by: nikki1200
9 Replies

5. Shell Programming and Scripting

Script to monitor a process and track status in a file

i have a scenario where i need a script that monitors a process "Monitor" based on process id... there can be any number of instances of this running... i start this across 4 servers in NFS. Now i need a file which has the process ids of the process that are currently in execution at any... (9 Replies)
Discussion started by: niteesh_!7
9 Replies

6. Shell Programming and Scripting

Track Child process exit

hi, I have a job that spawns multiple child processes in background.. Catch is i want to wait for some jobs to finish before i spawn more background processes. (each job creates a file and deletes at the end of it . so i don't want start new jobs after x amount of disk size is used up) now,... (2 Replies)
Discussion started by: ak_saravanan
2 Replies

7. Shell Programming and Scripting

how to track a log file of one process and mail that logfile to a group?

Hi Friendz, I have 14 DB load scripts say 1,2,3....14. I want a script to call each script automatically, and after completion of every script, it needs to track the logfile and mail that log file to a group.and again it should run the next script in sequence 1,2,3...14 Please help me,need... (1 Reply)
Discussion started by: shirdi
1 Replies

8. Shell Programming and Scripting

How to track and later kill a process in a script

Hello, I am trying to write a script that turns off the screensaver for a certain period of time, then come back on. I have had it up and running for a while, but then I decided to refactor it a bit for my family members that are less computer savvy. I am starting a subshell for the "meat" of... (4 Replies)
Discussion started by: Narnie
4 Replies

9. UNIX for Advanced & Expert Users

Problem to track process IDs in HP-UX machine

Hello All, I need to track the exact process ID related to a particular application running on HP-UX machine. i.e. the exact functionality of fuser unix command. fuser application.log // It gives the exact process ID for application.log Since there is no provision for 'fuser' in HP-UX... (13 Replies)
Discussion started by: abhishek0071
13 Replies

10. UNIX for Dummies Questions & Answers

Possible to track FTP user last login? Last and Finger don't track them.

Like the topic says, does anyone know if it is possible to check to see when an FTP only user has logged in? Because the shell is /bin/false and they are only using FTP to access the system doing a "finger" or "last" it says they have never logged in. Is there a way to see when ftp users log in... (1 Reply)
Discussion started by: LordJezo
1 Replies
Login or Register to Ask a Question