PDA

View Full Version : Moving file across network ?


dbrine
April 12th, 2008, 12:36 PM
I have a 2 Ubuntu Servers with mulitple HDD's. I need to move files/ Directories from 1 server to another. How do I do this? I could do it from a windows PC but would take forever.

volkswagner
April 12th, 2008, 12:50 PM
Use NFS.

http://ubuntuforums.org/showthread.php?t=249889

dbrine
April 12th, 2008, 01:09 PM
I'm new to Ubuntu Server so pardon my newbie questions... but Do I need NFS? I have samba setup and just need to relocate several files/ directories from 1 server to another. I have used scp but it keeps the old files on the other HDD and I get permission denied for some files?

schiznik
April 12th, 2008, 02:10 PM
assuming samba is setup correctly (which it is by the sounds of it), you should be able to use smbmount (manually or from /etc/fstab) to mount the shared folders. eg:smbmount //server/share /localdir -o username=user,password=pass,uid=500,gid=500Then you can mv the files as if they were all on a local machine.

Edit: No you dont NEED nfs - this is the unix/linux equivalent of samba (as used by windows). Stick to samba if you have windows machines, if its all mac/linux, I'd migrate to NFS.

hyper_ch
April 12th, 2008, 02:47 PM
I'd use sshfs...

dbrine
April 12th, 2008, 04:43 PM
I was unable to get the smbmount to work. Is there anything different I have to do since I have to linux boxes? The files are on those boxes.

hyper_ch
April 12th, 2008, 04:43 PM
see my post :)

dbrine
April 12th, 2008, 04:49 PM
I can't seem to get sshfs to work either. Gives me "Bad mount point"? Can I use scp -r and overwrite all files?

hyper_ch
April 12th, 2008, 04:51 PM
you first have to create the mount point...

dbrine
April 12th, 2008, 05:13 PM
LOL... finally got sshfs to work I can see the mount now. How do I move (command) all the files/ directories to another folders?

hyper_ch
April 12th, 2008, 05:18 PM
when you mounted it you can move/copy files accross the same way you do it normally...

use your file manager or command line...

I'd either us Midnight commander (mc) or konqueror as they are two-pane resp. multi-pane programs... mc is command line based but gives a ncurses interface.

dbrine
April 12th, 2008, 06:17 PM
I'm using the command line, No GUI server. I am moving them now. thanks for all the help. How do I force it to overwrite folders? files?

hyper_ch
April 12th, 2008, 06:22 PM
would be the -f parameter with copying... probably also with moving.... in mc you should be able to select an option after the first collission to overwrite everything

dbrine
April 12th, 2008, 06:27 PM
this is the command I used.

mv -f music/* /media/HDD-500-3/music


This is the error

I get this mv: inter-device move failed: `music/U2-2004_-_How_To_Dismantle_An_Atomic_Bomb' to `/media/HDD-500-3/music/U2-2004_-_How_To_Dismantle_An_Atomic_Bomb'; unable to remove target: Is a directory

firecat53
April 13th, 2008, 12:27 AM
You could try:

rsync -av --delete music /media/HDD-500-3/

Then delete the original folder if you're just moving it.

Or if you don't have sshfs set up, you can do it directly over ssh with:

rsync -av --delete -e ssh username@{machine name or IP address} music /media/HDD-500-3

Good luck!
Scott