Script to check transfer was successful

 
Thread Tools Search this Thread
Homework and Emergencies Homework & Coursework Questions Script to check transfer was successful
# 1  
Old 11-20-2012
RedHat Script to check transfer was successful

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

1. The problem statement, all variables and given/known data:
Write a script that performs a post processing action:

The run time environment of the script has the following environment variablesavailable when the script is fired.

TYPE: This can either be 'session' or 'file'. It indicates if transfer eventis a file or session event
FILE: The file being transferred
DIRECTION: This can be 'recv' or 'send'.Relative to the script, is thefile being sent or received.
STARTSTOP: This can be 'start' or 'stop'. Specifies if we are at the startor end of a file or session transfer event.
STATE: Either 'success', 'failed', or 'started'

You can assume that the script will be automatically executed on the followingevents (TYPE=session and STARTSTOP=start; TYPE=session andSTARTSTOP=stop; TYPE=file and STARSTOP=start;TYPE=file andSTARTSTOP=stop):

2. Relevant commands, code, scripts, algorithms:



3. The attempts at a solution (include all code and scripts):


Not sure where to start, scripting is new to me


4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Open University Foundation degree Computer science, UK

Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
# 2  
Old 11-20-2012
So, How do you check what a variable currently is?
Or how do you detect if a variable has a known value? This should look familiar
Code:
if [        ]

Hint: TYPE, FILE, DIRECTION, and STARTSTOP are variables that tell your code what to do.
# 3  
Old 11-21-2012
can you give me a start as this in not in my comfort zone.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

If statement to check file transfer

Hello Guys, I am trying scp few file within if statement, but getting error, can someone please help to understand, what mistake I am making ? if && ] ; then echo " Files transferred to Log servers successfully. " else echo " One or more file transfer failed over... (10 Replies)
Discussion started by: UnknownGuy
10 Replies

2. Shell Programming and Scripting

Check email successful sent and receive

We have a unix/linux server , that send mass email from it , the emails will pass the smtp gateway , email server and sent to the client , but sometimes the client do not receive the mail , we do not know the reason and when it will happen . We would like to have a script that check when the... (2 Replies)
Discussion started by: ust4
2 Replies

3. Shell Programming and Scripting

How to check the status of sftp connection is successful or not in Linux?

Hi All, We are working on linux with putty terminal for file transferring using SFTP server... here we want to know /We have Urgent Requirement If SFTP connection is successfull then we should get .txt log file in target locaton as "Success/Failure" Please provide batch script for above... (7 Replies)
Discussion started by: sravanreddy
7 Replies

4. UNIX for Dummies Questions & Answers

Ftp - file transfer and check successful delivery

In shell script, I want to transfer files continuously and make sure transfer is successful. Please advise... how to make sure ftp transfer is successful? Also is there any option such as sftp -b where I can pass multiple put <file name> commands to ftp Thanks! (1 Reply)
Discussion started by: vegasluxor
1 Replies

5. Shell Programming and Scripting

How to check whether the sftp script is successful??

hi, how can i check whether the sftp connectivity is successful or not?? i am using expect script to connect to sftp.. sftp_script spawn /usr/bin/sftp abc@ftp.xyz.com expect "abc@ftp.xyz.com's password:" send "password\r" expect "sftp>" send "mput *.txt\r" expect "sftp>" send "bye\r"... (8 Replies)
Discussion started by: Little
8 Replies

6. Shell Programming and Scripting

FTP Status check(whether it is successful or not)

Hi Friends I need to check the status of FTP connection i.e. Whether it is successful or not I have tried this by assigning the FTP connection script to a variable and after that using this variable I tried to check the status. In the below code snippet I am trying to assign the FTP... (1 Reply)
Discussion started by: Kannannair
1 Replies

7. Shell Programming and Scripting

How to check if the merge of two files is successful?

Hi All, I have a requirement to check if the merge of files is successful or not. The script to merge files goes like this, cat Rewards_Header Rewards_Siebel_Notif_temp Rewards_Siebel_Remind105_temp > Rewards_Siebel Sometimes, the file Rewards_Siebel misses records from file... (5 Replies)
Discussion started by: anandek
5 Replies

8. Shell Programming and Scripting

Delete File Only If Successful Transfer..

Hi. I have this shell script for ftp.. ftp -n 12.34.5.67 << EOF user username password cd LOCAL/inbox bin get JAN_Total.gz # del JAN_Total.gz EOF how do i modify the commented part i.e. del JAN_Total.gz only if that JAN_Total.gz has been successfully transfered to the local... (8 Replies)
Discussion started by: aimy
8 Replies

9. Shell Programming and Scripting

check if some file is in copy process, then transfer it

my user copy large files, and it's take 10min for file to be copied to the server (/tmp/user/ files/), if in the meantime start my scheduled script, then it will copy a part of some file to server1 my idea is to check the file size twice in a short period (1-2 seconds) of time, then compare, if... (5 Replies)
Discussion started by: waso
5 Replies

10. Shell Programming and Scripting

For loop scp transfers check if all iterations successful

All, I am using a for loop to SCP a bunch of files in a directory. I am having it then drop a .ready file name. Is there a way to check for the success of all iterations and then email upon fail or success? Example of part of my script: for file in $ORIGLOC/* do ] &&... (2 Replies)
Discussion started by: markdjones82
2 Replies
Login or Register to Ask a Question