1830149 Members
18307 Online
109999 Solutions
New Discussion

Name file ftp

 
Marcelo De Florio
Frequent Advisor

Name file ftp

How can i to rename the local file to remote file ?

local file: ppp remote file: ppp.`date remote`

MDF
6 REPLIES 6
Patrick Wallek
Honored Contributor

Re: Name file ftp

While in ftp:

get remote_file_name local_file_name

or

put local_file_name remote_file_name

If you are get'ting a file The local_file_name can be different from the original. If you are put'ting a file the remote_file_name can different from the original.
Marcelo De Florio
Frequent Advisor

Re: Name file ftp

I need change name in remote file added a file date of remote system on the fly,
eg: local file, ppp , remote file, pp.19052001

MDF
Klaus Crusius
Trusted Contributor

Re: Name file ftp

ftp does not support the execution of remote commands. What you can do is
either
use local DATE=$(date +%Y%m%d)
or
use remote DATE=$(remsh remotehost 'date +%Y%m%d')

The second option requires additional access privileges on the remote host, which a ftp-user usually does not have (see man remsh, .rhosts, inetd.sec).

There is a live before death!
Bill McNAMARA_1
Honored Contributor

Re: Name file ftp

try rcp:
rcp host2:/a/file /here/file

Later,
Bill
It works for me (tm)
Vincenzo Restuccia
Honored Contributor

Re: Name file ftp

After ftp:
#remsh remote_host -l remote_login_name -n "DATE=$(date +%Y%m%d);mv /PATH/ppp /PATH/ppp.${DATE}"
Bart Paulusse
Respected Contributor

Re: Name file ftp

use the rename command of ftp

rename filename newfilename

regards,

Bart