LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-13-2006, 02:26 AM   #1
astrollama
LQ Newbie
 
Registered: Oct 2006
Posts: 5

Rep: Reputation: 0
SCP copying directories between servers


I have an SCP query like this(its on the same server but different port):

scp -r /path/xml_documents_content/ ip_address:/path/xml_documents

What it does is copy everything from xml_documents_content into xml_documents folder on target, BUT it creates a new folder xml_documents_content under the/xml_documents folder, and I just want the files to go straight into the xml_documents folder.

Any help? Please?
 
Old 10-13-2006, 02:32 AM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
rsync instead? Other than that, does a .* help?
scp -r /path/to/files/.* ip:/path/to/files

Cool
 
Old 10-13-2006, 02:47 AM   #3
astrollama
LQ Newbie
 
Registered: Oct 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by MasterC
rsync instead? Other than that, does a .* help?
scp -r /path/to/files/.* ip:/path/to/files

Cool
I tried
scp -r /path/xml_documents_content/* ip_address:/path/xml_documents
but then I got errors, as Ive got a heap of directories under xml_documents_content
and got errors like '61414' is not a regular file
 
Old 10-13-2006, 02:53 AM   #4
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
Is rsync a bad (or unavailable) option?

Cool
 
Old 10-13-2006, 02:59 AM   #5
astrollama
LQ Newbie
 
Registered: Oct 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by MasterC
Is rsync a bad (or unavailable) option?

Cool
To be honest, it could be an option. The person a bit higher up than me in my job told me to use scp, and I put to them the rsync option and they said they've never used it before.
Could you perhaps give me an example of how I'd do the rsync?
 
Old 10-13-2006, 03:10 AM   #6
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
Sure, I'll show you what I use, and then point you to the document describing how to do what I use:
Code:
* * * * 1 rsync -e ssh -avz user@example.com:/path/to/files/ /path/to/backup/ 2>&1 /var/log/weekly-backup.log
I set that cronjob (notice the * * * ) on the machine doing the backup, not the server where the files actually live and are served from (it's a website backup job). So, the docs:
http://www.linuxquestions.org/linux/...etween_servers
and then to have the public key arrangement to automate this process in cron (also linked in the above document):
http://www.linuxquestions.org/linux/...ation_with_ssh

HTH

Cool
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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] scp directories ? the_rhino Linux - Newbie 12 10-03-2012 02:51 PM
Strange scp issue while copying files gettons_slack Linux - Software 2 08-26-2006 06:33 AM
Strange scp issue while copying files gettons_slack Slackware 7 08-25-2006 02:53 PM
scp copying from Linux to windows richard3403 Linux - Networking 2 11-06-2003 07:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:06 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration