ftp. copy if size differs


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ftp. copy if size differs
# 1  
Old 12-30-2008
ftp. copy if size differs

Hi.
On my system there is a script which making backup to ftp site. But it leaves copy of files on local machine. Then i go to Midnight Commander and check manually with MC features - i open ftp directory and copy files <if size differs>.

So, how can i do the last thing in shell or other language - copy to ftp site only if size of local files and ftp files differs. And then delete, if not.
# 2  
Old 12-30-2008
Does your FTP site also support the rsync command? It is much better at handling things like that.

Otherwise you could do ls via FTP and use sed or awk to extract the size. Then with regular shell scripting compare, transfer, delete.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compare file size and then copy/overwrite

// Redhat I have this code working, but need to add one more qualification so that I don't overwrite the files. #!/bin/sh cd /P2/log/cerner_prod/millennium/archive/ for f in * do || continue #If this isn't a regular file, skip it. && continue #If a backup already... (2 Replies)
Discussion started by: Daniel Gate
2 Replies

2. UNIX for Advanced & Expert Users

FTP zero size file

Hi AM using unix Aix Ksh I need to clarify regarding sending the zero size file to another server. VAL=ftp.sh -c put souce_file Dest_file $1 $2 $3 $4 $5 $VAL 2 > $ERR When am Sending the Zero Size File getting alerts netout write returned Zero. But i would like to know $VAL... (4 Replies)
Discussion started by: Venkatesh1
4 Replies

3. Shell Programming and Scripting

Ftp : Size

Hi All, I have a very simple requirement which is stopping me from completing my assignment. During FTP session, I can get the size of the file using "`size filename`". In the same way how to get the size of a directory?? I've searched our site as well as the web, couldn't find anything... (4 Replies)
Discussion started by: Naga06
4 Replies

4. Shell Programming and Scripting

Checking the size of a file after FTP

Hi I am doing a FTP process through which I am copying a file from my local server to Remote server. After this I want to check the size of the file Below is my program: LOCALDIR=/batch/ediprocess REMOTESERVER=test.appl.com REMOTEPATH=batch/ftpTest LOGIN=px PASSWORD=abcd ftp -n... (3 Replies)
Discussion started by: shanth_chandra
3 Replies

5. UNIX for Dummies Questions & Answers

Copy a file based on the size-Urgent

Hi, I need unix code to check the size of a file. for example if the size of the file in A folder is more than 1BM, then i have to move that particular file in to B folder whenever I run that particular script. regards, Srinivas. (7 Replies)
Discussion started by: vysrinivas
7 Replies

6. Shell Programming and Scripting

how ./example.sh differs from . /example.sh and ./ example.sh

May i know the difference between the execution of the commands: ./example.sh . /example.sh and ./ example.sh the last and last but one is having space in between that is the difference please suggest me the answer for this...:confused: (4 Replies)
Discussion started by: lokeshpashine
4 Replies

7. Shell Programming and Scripting

How to compare file size after ftp?

Is possible if I want to campare file size on source and destination after ftp transfer? If anybody know, please explain to me. (1 Reply)
Discussion started by: icemania
1 Replies

8. Shell Programming and Scripting

How to copy Folder with FTP

Dear All, I'm new in Unix System, can you help me about how to copy folder using FTP command. I have folder name "/heru" and I want copy this folder to my windows system. how to copy this folder? and how to copy all file that using 1 extesion to other divice using ftp for example I want... (1 Reply)
Discussion started by: heru_90
1 Replies

9. Solaris

gcc output size differs on same version of solaris

Hello everybody, I am having two machines. I am using g++v2.95 When I do the build,the size of output file on both machines differ. I am not able to find what can be the problem. Both the machines are solaris 5.6 The command is : g++ -c -g -I./ -I../../../include -I/usr/local/include/g++-3... (1 Reply)
Discussion started by: manishs13
1 Replies

10. UNIX for Advanced & Expert Users

ftp file size

how to compare file size which has been received through ftp get from a remote location with local copy available any clue regards (5 Replies)
Discussion started by: sathiya
5 Replies
Login or Register to Ask a Question