file FTPed to another destination?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting file FTPed to another destination?
# 1  
Old 07-02-2010
file FTPed to another destination?

Hi,

The scenario which I am describing here is strange but not a product of my imagination!

I have a SFTP script which gets file from remote server to a local directory say (/home/dips/ftp/my_files) inside my_files/ there's another sub-dir archive/

The strange scenario is that once while FTPing a huge encrypted file (~570000000 bytes) the file got pulled to archive/ and not to the my_files/ as should be the case. When I saw the file in archive/ I issued the command to move it to my_files/ as the other processes would expect it to be there. And when I executed the below command:

Code:
 
$pwd
/home/dips/ftp/my_files
$mv archive/remote_file.csv.gpg .

It did that in literally one second!! which is not possible as the file is huge and it takes lots of minutes to move from one directory to another.

Now I am puzzled is the above scenario a plausible one? Please explain

-dips
# 2  
Old 07-02-2010
mv has two options:
1. if the file is in the same filesystem from source to destination, just move the file's metadata from one directory to another.
2. If the destination is on another filesystem, then cp the file.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Oracle Linux issue - all files FTPed to it from windows need to to be processed with dos2UNIX

Hello Friends, I have observed one recent issue about ftp from windows to Linux. Initially we had Solaris unix and any file sent from windows to solaris via ftp (binary or ascii) worked smoothly. Say for e.g if I sent a shell script to soalris from windows, that script used to run corectly.... (17 Replies)
Discussion started by: Albert_Pinto7
17 Replies

2. UNIX for Dummies Questions & Answers

After Ftp'ing file to destination how to check the file if it is in correct ASCII and not corrupted

Hi Folks, While transferring file from FTP software like Filezilla the files gets corrupted. Is there any way I can check if the recently transferred file is in ASCII and not corrupted. I have tried using file -i filename command which does tell if the file character set is ASCII or binary... (6 Replies)
Discussion started by: Khan28
6 Replies

3. UNIX for Dummies Questions & Answers

How to create a TAR File in a Custom Destination Directory?

I want to create the tarzip file into a destination directory, i am in /var/sftp/home/archive/rquadri directory and i am using below command. However it is creating the file in the /var/sftp/home/archive/rquadri directory itself instead of /tmp, may i please know how do i resolve this. tar -cvzf... (5 Replies)
Discussion started by: Ariean
5 Replies

4. Shell Programming and Scripting

How to find the one file and move destination using scripts in AIX?

I have run the one scripts the scripts is provide the two different format of output.How to getting the output. (2 Replies)
Discussion started by: rajivgandhi
2 Replies

5. Shell Programming and Scripting

How to find the one file and move destination using scripts in AIX?

I have a script which has two output formats in which i'am getting the two different output format in str1 and str2.So i want to get the output if the format is like str1 then i have to copy that into a directory or str2 format means it should be moved.This script i'am executing in shell script... (4 Replies)
Discussion started by: rajivgandhi
4 Replies

6. Shell Programming and Scripting

Help with cp command when destination file is opened

I am writing a shell script (runs on HP Unix) which copies files from a source directory to another destination daily. The destination directory always have the files with same name as in the source directory. And daily a new file will be created in the source. cp command works fine if the file... (1 Reply)
Discussion started by: arunkumar_ms
1 Replies

7. UNIX for Dummies Questions & Answers

copy files grabbing destination folder from file name

Hi all... Below is what I am trying to do: 1. Having the following folder with the files... /source_folder/dodiddone.tar.gz /source_folder/gowentgone.tar.gz /source_folder/gowentgone.log 2. I need to copy and chown files with extension .tar.gz to another folder copy... (1 Reply)
Discussion started by: pedroz
1 Replies

8. Red Hat

Copy certain file types recursively while maintaining file structure on destination?

Hi guys, I have just been bothered by a fairly small issue for some time now. I am trying to search (using find -name) for some .jpg files recursively. This is a Redhat environment with bash. I get this job done though I need to copy ALL of them and put them in a separate folder BUT I also... (1 Reply)
Discussion started by: rockf1bull
1 Replies

9. Shell Programming and Scripting

Need year to display from ftped files list

Hi All, p_ftp=dummy time ftp -niv 192.0.0.2 << EOF user dummy dummy cd prt/$p_ftp ascii ls -ltr quit output is -rw-r--r-- 1 500 500 5137 Mar 04 11:21 dummy.csv can any one suggest how to get year while using ftp (1 Reply)
Discussion started by: Vrgurav
1 Replies

10. UNIX for Advanced & Expert Users

How to unzip a file ftped from Window box?

Hi, How to unzip and file which FTP'ed from Windows box? File name is ABC.ZIP I tried unzip and gunzip -S .ZIP ABC.ZIP i am getting following error gunzip: ABC.ZIP: unknown suffix -- ignored Any info is appreciated! ~t (10 Replies)
Discussion started by: terala_s
10 Replies
Login or Register to Ask a Question