LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-22-2012, 07:52 PM   #1
swagcute
LQ Newbie
 
Registered: Jul 2012
Posts: 13

Rep: Reputation: Disabled
rsync bunch of files with space


I need to copy a bunch of files from one server to the other where most of the files and folders contain spaces. Basically I'm moving bunch of directories created by windows clients in samba file server to the new samba server. So i don't need to preserve the permissions or owners of previous samba user. I used the following command and more combinations but none of them seems to be copying files and folders with spaces.
sudo rsync -rv root@192.168.1.2:/home/users/abcd /data/home/abc
 
Old 08-22-2012, 08:07 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
If this is a one-off copy (as it sounds) then rsync is overkill; its main claim to fame/efficiency is only copying file changes.; in this case that's 100% anyway.
I'd just use
Code:
# on target box
cd /data/home/abc
scp -r root@192.168.1.2:/home/users/abcd/* .

#reverse args if starting from src box
 
Old 08-22-2012, 08:36 PM   #3
swagcute
LQ Newbie
 
Registered: Jul 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
Thanks for the reply. Now I've used scp and still the files and folders with space not copied. Please help me out.
 
Old 08-22-2012, 08:51 PM   #4
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
well,.. rsync should pick up the spaces fine.

Code:
rsync -varh --progress /from/dir/ /to/dir/
 
Old 08-23-2012, 06:24 PM   #5
swagcute
LQ Newbie
 
Registered: Jul 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
Thanks for the command. I have already tried similar. It copy the files with blank space but permission is denied as it keep the original ownership from previous fileserver. But then I issued chmod -R and chown -R to solve the problem.
 
Old 08-23-2012, 07:30 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Hmmm just tested this (ip obscured)
Code:
scp * user@1.2.3.4:/tmp
with a file with a space in name; worked fine.

Last edited by chrism01; 08-23-2012 at 07:32 PM.
 
Old 08-24-2012, 09:57 AM   #7
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
I see it also working with scp. Can you provide any error information? You can also use tar:
Code:
$ ssh root@1.2.3.4 tar cz -C /home/users abcd | tar xz -C /data/home/abc
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Files seem to take up more space in destination after rsync copy Karderio Linux - Newbie 6 09-22-2014 07:41 PM
renaming a bunch of files using for and mv vituttaa Linux - Newbie 6 02-03-2010 04:57 PM
Rename a bunch of files auwolf Linux - Newbie 9 10-06-2006 01:55 AM
un-TARring a bunch of files at once grapnell Linux - General 2 02-12-2006 09:18 AM
un-TARring a bunch of files at once grapnell Linux - Software 4 02-12-2006 09:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration