Advanced file transfer


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Advanced file transfer
# 1  
Old 06-29-2011
Advanced file transfer

Hey all.

I need to transfer files from one system to about 5 other systems, and i have to do it manually, and we do get a lot of requests for the same. Presently this is done using a shell script, but it has to be run on each of the 5 systems. Also, a backup of the file needs to be preserved before deploying the new one. FTP does not allow renaming copying the file on the remote system. i am at my wits end tryin to figure out a solution SmilieAny help would be appreciated.
# 2  
Old 06-29-2011
Is ssh/scp/sftp an option for you?
# 3  
Old 06-29-2011
I dont think so. It still doesnt solve the problem of backing up the existing file before deploying the new one. Will any of these commands work from a single machine? heres what i need: Transfer files from one single machine to 4 other machines. Preserving backup of the file being transferred is very critical. FTP does not work for me as it does not allow renaming of files. I feel SSH is dangerous for me to use.
# 4  
Old 06-29-2011
ssh is not dangerous at all. ssh which bring scp and sftp as well is encrypted while ftp is not encrypted at all.
When you already have a shell script, create a list of which files you want to transfer, simply make a backup with the cp command for example and then scp/sftp them away.
Using scp/sftp in scripts, you usually create password/passphrase less key pairs, a public and a personal key. You give or exchange the pub key with the other side. When they add it to their .ssh/authorized_keys they will allow you to connect with that user without having to enter a password. So there will also no password be in your scripts.
To serve several target hosts, you will just have to work a list of hosts in your script, inside a for loop for example.
# 5  
Old 06-29-2011
Does this take care of backing up the existing files on all the target machines?
if i have 5 machines, i need to preserve the backup on all the 5 machines.
# 6  
Old 06-29-2011
If you script it, yes. You could issue that remote backup with ssh.
# 7  
Old 06-29-2011
Quote:
FTP does not work for me as it does not allow renaming of files.
Relative to the server which initiates the ftp, there is no ftp "rename" command for local files but there is ftp "rename" for remote files (subject to directory permissions). Note that the command is actually "rename" not "mv".
It is conventional to ftp files under a temporary name then rename them after a successful transfer.
Assuming you will be initating the the ftp from the master computer you could rename the target file just before renaming the file you transferred successfully under a temporary name.

You can ftp to "localhost" if it is important to use ftp to rename local files but most scripters would just use shell commands.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

File transfer

When using FTP to transfer a file from IBM iSeries family of servers client to a non IBM Iseries family server, files might have characters appear in the wrong format Eg | in Iseries and while transferring fro Iseries system to Linux , but instead of | it is showing as ?. Please advise (3 Replies)
Discussion started by: sudhainit
3 Replies

2. Shell Programming and Scripting

Advanced: Sort, count data in column, append file name

Hi. I am not sure the title gives an optimal description of what I want to do. Also, I tried to post this in the "UNIX for Dummies Questions & Answers", but it seems no-one was able to help out. I have several text files that contain data in many columns. All the files are organized the same... (14 Replies)
Discussion started by: JamesT
14 Replies

3. Shell Programming and Scripting

Avoiding file overwrite during file transfer using scp

Hi, I have written a small script to transfer a file from one unix server to other using scp command which is working fine. As I know with scp, if any file with the same name is already present on destination server, it would get overwritten without any notification to user. Could anyone help me... (14 Replies)
Discussion started by: dsa
14 Replies

4. SCO

Advanced File and Print Server (AFPS)

I'm looking for a 25-user AFPS license - this was a product available on SCO UnixWare 7.1.3 (was superseded by Samba in 7.1.4) Anyone have one sitting at the back of a cupboard/drawer/garage... I have a buyer lined up! (1 Reply)
Discussion started by: billbateson
1 Replies

5. Shell Programming and Scripting

File transfer

Hi All, it might not be an sound question, i have two server like A and B.. i want to transfer file from B to A ..here i have some questions.. 1) do we need to create private and public key to connect..and transferring files...from B to A..? 2) i tried with scp options like... (2 Replies)
Discussion started by: Shahul
2 Replies

6. Shell Programming and Scripting

Advanced Search & Delete Text File

I have a file in which email messages are stored in. Every email is separated by by a ^Z character (Control-Z). I need to extract all emails after the 65,00th one to another file and delete them from the original file. Any suggests on accomplishing this? (2 Replies)
Discussion started by: maxcell
2 Replies

7. UNIX for Dummies Questions & Answers

Advanced File Rename help

So, I am so new that I can't even call myself a unix user. I have an aptitude for programing, but I don't know the language. Anyway, here is my problem: I have to rename a batch of files that look like: 2001_0001.asc 2001_0002.asc . . . 2006_0548.asc The names are a date code, but... (1 Reply)
Discussion started by: sea krait
1 Replies

8. UNIX for Advanced & Expert Users

advanced file renaming problem

I know this is probably a question for the newbie forum, where it is also posted, but I thought maybe some of you pros might like to help me out anyway. Here is my problem: I have to rename a batch of files that look like: 2001_0001.asc 2001_0002.asc . 2001_0548.asc 2002_0184.asc . .... (0 Replies)
Discussion started by: sea krait
0 Replies

9. UNIX for Dummies Questions & Answers

Transfer the file

Dear all, Can anybody let me know how to automate a file transfer process to a remote m/c thru SFTP , automate means it will not prmpt for password. how i am going to achive this....and what all methods are available or tools are available ???? (2 Replies)
Discussion started by: manas_ranjan
2 Replies

10. Shell Programming and Scripting

file transfer

hi all how do i copy a file from one server to another thanks bkan77 (4 Replies)
Discussion started by: bkan77
4 Replies
Login or Register to Ask a Question