Sponsored Content
Operating Systems Solaris Ftp a directory to another server from the local server what is the command Post 302879565 by jim mcnamara on Friday 13th of December 2013 06:31:46 AM
Old 12-13-2013
Does the directory already exist on the remote box?

Can you use ssh to connect or do you have to use ftp?

This is the best and basically only choice, which preserves file permissions and ownership, command from the source machine:

Code:
tar cpf - /some/important/directory | ssh user@destination-machine "tar xpf - -C /some/newdirectory/"

There is no ftp equivalent. And if you cannot log onto the remote box you will have to manually create the directory using the ftp command mkdir, then copy each file over:
Code:
cd /path/to/source-directory
HOST='remote-box'
USER='you'
PASSWD='yourpw'
FILE='file.txt'

ftp $HOST <<-EOF
user $USER
$PASSWD
cd /path/to/
mkdir newdirectory
quit
EOF

for fname in *
do

ftp $HOST <<-EOF
user $USER
$PASSWD
cd /path/to/newdirectory
put $fname
quit
EOF

done

Last edited by jim mcnamara; 12-13-2013 at 07:44 AM..
This User Gave Thanks to jim mcnamara For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

FTP multiple files from remote server to local server

Hi, I am facing a weired problem in my FTP script. I want to transfer multiple files from remote server to local server everyday, using mget * in my script. I also, want to send an email for successful or failed FTP. My script works for file transfer, but it don't send any mail. There is... (2 Replies)
Discussion started by: berlin_germany
2 Replies

2. Shell Programming and Scripting

Dowloading a File from FTP Server to a local Server where User Id's are different

Hi, The Setup is like this. I'm connecting to Unix machine from my local machine. After connecting to Unix M/c, i need to connect FTP server. Am successful in connecting to FTP server, but am not able to download the file from the ftp server to my local machine. I have different user id's and... (1 Reply)
Discussion started by: ranjith_taurean
1 Replies

3. Shell Programming and Scripting

how to FTP a file from the local folder to unix server

Hi All, please help me to write a shell that ftp a file which is in the local (C:\) drive to a Unix server. Where as i know the IP for the Unix server. i could do this process by using ftp command. pls help me to write as Shell script. Thanks in advance for all of your answers.:b::b: (3 Replies)
Discussion started by: little_wonder
3 Replies

4. Shell Programming and Scripting

preserving the timestamp of a file when copied from remote server to local server using ftp

Hi, I need to copy few files from remote server to local server. I write a shell script to connect to the remote server using ftp and go to that path. Now i need to copy those files in the remote directory to my local server with the timestamp of all those files shouldnt be changed. ... (5 Replies)
Discussion started by: arunkumarmc
5 Replies

5. AIX

Do I need to configure my local windows to FTP files from local windows to a UNIX AIX server?

Hi Friends, I have this script for ftping files from AIX server to local windows xp. #!/bin/sh HOST='localsystem.net' USER='myid_onlocal' PASSWD='mypwd_onlocal' FILE='file.txt' ##This is a file on server(AIX) ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD put $FILE... (1 Reply)
Discussion started by: rajsharma
1 Replies

6. Shell Programming and Scripting

Validating the size of file transferred from ftp server to the local system

Validating the size of file transferred from ftp server to the local system. File type: Text file/Flat file Source System: Windows / Unix Systems Target System is always: Unix Mode of Transfer : ASCII We have generic ftp shell script that transfers the files from different ftp servers. ... (2 Replies)
Discussion started by: jpundalik
2 Replies

7. Shell Programming and Scripting

ftp files from local sys to unix server

Hi All, can anybody explain me how to ftp files from local system to unix server using Shell scripting without using any softwares. i have developed some code but its not wrking. lclpath=/dba58/d039/ftppubd/ajay echo $lclpath cd $lclpath user='rajesh' pswd='rajesh' host="3.209.136.253"... (5 Replies)
Discussion started by: rajesh_pola
5 Replies

8. Shell Programming and Scripting

FTP files from different directory from remote server to one directory in local

Hi All, I want to search for .log files from folders and sub folders in remote server and FTP them to one particular folder in the local machine. I dont want to copy the entire directory tree structure, just have to take all the .log files from all the folders by doing a recursive search from the... (3 Replies)
Discussion started by: dassv
3 Replies

9. Solaris

Script to get files from remote server to local server through sftp without prompting for password

Hi, I am trying to automate the process of fetching files from remote server to local server through sftp. I have the username and password for the remote solaris server. But I need to give password manually everytime i run the script. Can anyone help me in automating the script such that it... (3 Replies)
Discussion started by: ssk250
3 Replies

10. Shell Programming and Scripting

Deleting local server file from automated FTP script

Hi, I want to delete a file on the local server, while connected to remote server through FTP. I am using the below code for this $FTP_CMD -v -n $HOST <<*! >> $LOGFILE 2>&1 user $USER $PASSWORD cd $DIR ... (11 Replies)
Discussion started by: jhilmil
11 Replies
vfs-filesystems(n)														vfs-filesystems(n)

__________________________________________________________________________________________________________________________________________________

NAME
vfs-filesystems - Filesystems provided by tclvfs SYNOPSIS
package require Tcl 8.4 package require vfs ?1.2.1? package require vfs::zip ?1.0? package require vfs::mk4 ?1.6? package require vfs::tar ?0.9? package require vfs::ftp ?1.0? package require vfs::ns ?1.0? package require vfs::webdav ?0.1? package require vfs::http ?0.5? package require vfs::urltype ?1.0? vfs::zip::Mount path to vfs::mk4::Mount path to vfs::tar::Mount path to vfs::ftp::Mount path to vfs::ns::Mount path to vfs::webdav::Mount path to vfs::http::Mount path to vfs::urltype::Mount path to _________________________________________________________________ DESCRIPTION
The package vfs provides not only the means to implement a virtual filesystem at the tcl level, but also a number of ready to be used filesystems as well. Each of these filesystem exists as its own package, and can be accessed through package require vfs::NAME. The whole set of these virtual filesystems is known informally as 'vfslib'. SUPPORTED VFS TYPES
Currently supported are ftp, tar, http, zip, mk4, ns, and webdav. In addition there is the ability to mount any 'urltype' as a new direc- tory, provided an appropriate vfs is supported. This means that you can treat urls based on the schemes ftp://, http:// and file:// as files. To do this, simply evaluate the command vfs::urltype::Mount ftp for example. Any access inside the new volume will result in an attempt to require a package through package require vfs::${type}, which must therefore exist, or errors will be thrown. If a filesystem is loaded, use the associated command listed below to mount a source for that filesystem as a tcl directory. vfs::zip::Mount path to Mount the zip file path as directory to. vfs::mk4::Mount path to Mount the metakit database file file path as directory to. vfs::tar::Mount path to Mount the tar file path as directory to. vfs::ftp::Mount path to Mount the ftp url path as directory to. vfs::ns::Mount path to Mount the tcl namespace path as directory to. vfs::webdav::Mount path to Mount the webdav url path as directory to. vfs::http::Mount path to Mount the http url path as directory to. vfs::urltype::Mount path to Mount the url path, of type urltype as directory to. LIMITATIONS
Most of the vfs types listed above have not been very well debugged as yet. Please test them! SEE ALSO
vfs, vfs-fsapi KEYWORDS
file, filesystem, ftp, http, metakit, namespace, tar, vfs, vfslib, webdav, zip COPYRIGHT
Copyright (c) 2001-2003 Vince Darley <vincentdarley@users.sourceforge.net> Copyright (c) 2003 Andreas Kupries <andreas_kupries@users.sourceforge.net> Tcl-level Virtual Filesystems 1.0 vfs-filesystems(n)
All times are GMT -4. The time now is 03:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy