I want to copy files from pc to pc

Asked by Doug Moulton

I want to write a script to copy files from 1 pc to another pc
I also need to know how to schedule this

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Tim Potter (musikgoat) said :
#1

There are a number of ways to accomplish this, but more informaiton is needed.

1. What are the operating system and versions of each PC?
2. How are they connected, i.e. in a local network, across the internet behind routers, or something else?
3. How much data are you looking to transfer, alot of files, all in a particular folder, or scattered?

Revision history for this message
Doug Moulton (doug-moulton) said :
#2

1) the receiving PC is using Ubuntu 8.04 & the sending PC is a older unknown version of Unix
- when using the Ubuntu PC - I can see the other Unix PC by its IP & copy the files manually
- I can use Places & Connect to Server
2) both are on the same local network
3) there is only 1 folder to copy - but quite large - about 16 GB of data

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#3

The most important needed here is something more about "...the sending PC is a older unknown version of Unix..."

Do you have access to it... ?

Can you open a terminal or go to console of that pc, make login with user and password then type:

cat /etc/issue

Copy and paste result here...

Thank you

Revision history for this message
Tim Potter (musikgoat) said :
#4

Doug,

I would say your best solution for local network transfer would be either ftp, or smb from the command line. Alternatively, if some or most of the data stays the same from copy to copy, and you are attempting to make a backup of the data in that folder, then rsync would be the best approach. You want to make that determination before you go about creating a script, and then creating a "cron job" to copy that data.

smb has more overhead than ftp, but there seems to be either an smb or an ftp daemon running on the sending pc.

what are the parameters used when connecting via: Connect to Server?

Revision history for this message
Doug Moulton (doug-moulton) said :
#5

Tim - ok - I have tried putting FTP & mget in a script & it work well - thanks

next problem is with FTP - using a mget command in FTP seems a little tedious - is there a command in FTP that will
copy folders & sub-folders & sub files

thanks again

Doug

Revision history for this message
Tim Potter (musikgoat) said :
#6

some ftp clients support recursive mget. the BSD ftp client built into Ubuntu does not.

However, lftp does with the mirror command.

sudo apt-get install lftp

edit your script to call lftp and play with the mirror command. I would test it in the terminal, like:

cd /path/to/localbackup/; lftp -e mirror ftp://username:password@remote/path/to/dir_to_be_backed_up

from the lftp man page:

mirror [OPTS] [source [target]]

Mirror specified source directory to local target directory. If target directory ends with a slash, the source base name is appended to target directory name. Source and/or target can be URLs pointing to directories.

Can you help with this problem?

Provide an answer of your own, or ask Doug Moulton for more information if necessary.

To post a message you must log in.