rsync in ftp


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting rsync in ftp
# 1  
Old 10-23-2005
rsync in ftp

Hello, everyone.

I want to UP files in folder: FROM which is in local.
to server folder: TO by ftp script.

Code:
cd /$HOME/FROM

# Begin FTP
ftp -i -n $HOST << END
user $USER $PASSWD

# Command in FTP
cd public_html/TO
rsync -auv --delete FROM TO <--- I think this won't work but I want to do like this!!

quit
END
# End FTP

Now, in my local FROM folder, I have
2.txt 3.txt 4.txt
and in TO folder,
1.txt 2.txt 3.txt

there is some changes in file 3.txt, and i want to do on TO folder,
1. remove 1.txt
2. make no change to 2.txt
3. change 3.txt (because it has been changed in local)
4. put 4.txt

After this, TO folder has changed to:
2.txt 3.txt 4.txt
Now 3.txt is the new one.

Please tell me how to do this in compact script!!
THANKS.
# 2  
Old 10-23-2005
FTP Rsync mixup

I think you're mixing your commands.

ftp is a command for doing file transfers. Type "ftp" from your shell command line, then type "help". It will tell you what commands are available.

rsync is another command for sync'ing two directories.

So first, we have to know: what do you have available, rsync or ftp? Are you the administrator of your computers? How important is security to you? (rsync uses rexec which is notoriously insecure) Can you compile problems on your computers? If so, you may want to use ssh and the scp command. Do you have perl? This may make testing file modification times easier to test.

The easiest answer, by far, is to use rsync. This is what rsync was designed to do. And for that you do not need a script- a one-line rsync command is all you need.

But it sounds like you don't have it, otherwise you wouldn't be asking for a script, no? Well with more information we would be in a better position to answer the question in a way that meets your needs.
# 3  
Old 10-23-2005
Quote:
Originally Posted by mschwage
rsync uses rexec which is notoriously insecure
Actually, rsync can use either rsh/rexec or ssh, or can even be run as a daemon.
# 4  
Old 10-23-2005
Thank you for kindness.
This is my env.

ftp> help
Commands may be abbreviated. Commands are:

! disconnect lpage nlist rate sndbuf
$ edit lpwd nmap rcvbuf status
account epsv4 ls ntrans recv struct
append exit macdef open reget sunique
ascii features mdelete page remopts system
bell fget mdir passive rename tenex
binary form mget pdir reset throttle
bye ftp mkdir pls restart trace
case gate mls pmlsd rhelp type
cd get mlsd preserve rmdir umask
cdup glob mlst progress rstatus unset
chmod hash mode prompt runique usage
close help modtime proxy send user
cr idle more put sendport verbose
debug image mput pwd set xferbuf
delete lcd msend quit site ?
dir less newer quote size
ftp>

Of course, there is no rsync command.

>what do you have available, rsync or ftp?
I have both.

>Are you the administrator of your computers?
I am admin of my notebook, but not admin of web server (XREA.com).
I have my HomePage, on this server, and I want to update automatically.

>How important is security to you?
I want to send some of my personal text files, but I think security is not so important.

>Can you compile problems on your computers? If so, you may want to use ssh and the scp command.
I can't understand about this.

>Do you have perl?
Yes. And I can understand it.

>The easiest answer, by far, is to use rsync.
I have to input password and username, when I want to get into the server computer.
So, I don't know what the expression on rsync will be.

Does this make sense?
Sorry for my bad English.
# 5  
Old 10-23-2005
I think this thread in the frequently asked questions is what you are looking for.
# 6  
Old 10-24-2005
I will learn this.
THANK YOU!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Rsync Error: rsync: link_stat failed: No such file or directory (2)

I wish to copy all the files & folder under /web/Transfer_Files/data/ on mymac1 (Linux) to remote server mybank.intra.com (Solaris 10) /tmp/ location I am using Ansible tool synchronize module which triggers the unix rsync command as below:rsync --delay-updates -F --compress --archive --rsh=ssh... (2 Replies)
Discussion started by: mohtashims
2 Replies

2. Solaris

FTP log only shows FTP LOGIN FROM entry?

OS: Solaris 9 Configuration /etc/syslog.conf daemon.debug /etc/inetd.conf ftp stream tcp6 nowait root /usr/sbin/in.ftpd in.ftpd -A -l -d Found the ftp.log only generate those entries from other servers/hosts. Can we trace on all ftp entries either from/to the server? ... (6 Replies)
Discussion started by: KhawHL
6 Replies

3. HP-UX

[Solved] Unable to rename file in ftp server .Net:FTP perl

Hello All, I am trying to connect to ftp server and get the files. Also i need to rename the file in other ftp dir. rename method is not allowing me to rename the file in other dir. When i tried copy command by using net::FTP:FILE then perl says it is not installed. Can some body help me to... (2 Replies)
Discussion started by: krsnadasa
2 Replies

4. AIX

ftp connect in passive mode , ftp settings

how to connect to ftp server in passive mode? ftp server.abc and how can i see ftp settings, doesn't exist some ftpd.conf there is some other file where i check the options and configurations of ftp server? Thanks (3 Replies)
Discussion started by: prpkrk
3 Replies

5. Shell Programming and Scripting

RSYNC script to transfer folders recursively without overwriting via FTP

Hi all, I would need a bash script to sync/transfer folders recursively via FTP/RSYNC (I initially planned to use FTP but I heard RSYNC would fit a lot better for this job(?)) The situation: 3 different Linux servers 1. source 2. destination - Samba 3. Server where the script runs on ... (2 Replies)
Discussion started by: thibautp
2 Replies

6. Shell Programming and Scripting

Automated FTP script using .netrc to multiple FTP servers

Hi all, I'm using the following script to automated ftp files to 1 ftp servers host=192.168.0.1 /usr/bin/ftp -vi >> $bkplog 2>&1 <<ftp open $host bin cd ${directory} put $files quit ftp and the .netrc file contain machine 192.168.0.1 login abc... (4 Replies)
Discussion started by: varu0612
4 Replies

7. Shell Programming and Scripting

passing parameter to ftp script from output of another ftp

Hi, I have a ftp script which first gets all the file names and echo's the latest file. I'm using another ftp command sets to get the file name given by first ftp. The problem is the parameter is not accepted by second ftp. The error message i'm getting is > Rename Temp File calloc:ICMP... (5 Replies)
Discussion started by: ammu
5 Replies

8. UNIX for Advanced & Expert Users

Using FTP to check whether file is completely FTP... plz find the description below

Hi, We have some clients who will place huge files in to one of the remote server. And the shell script written in our local server to retrieve client files (using FTP) placed on one of the remote server of ours by clients. My question Is there any FTP command/script to check from my local... (1 Reply)
Discussion started by: nmsrao
1 Replies

9. UNIX for Advanced & Expert Users

rsync over ftp

I need something like rsync but for synchronizing files on ftp server (perl is acceptable) Thank you for advice (2 Replies)
Discussion started by: Hitori
2 Replies

10. Shell Programming and Scripting

FTP script to FTP file to UNIX - Solaris

Hello, A couple of times per week, i receive emails notifications when files are available for processing. Currently i read these eamails with a java program and store the attachement on my C: drive and would now like to generate a PC script to send this file name up to UNIX-Solaris and... (3 Replies)
Discussion started by: bobk544
3 Replies
Login or Register to Ask a Question