LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 01-31-2010, 11:19 PM   #1
ssisbi
LQ Newbie
 
Registered: Jan 2010
Posts: 13

Rep: Reputation: 0
cp command - update flag question


my system is running cp version 5.97. i want to use it with the update flag to synchronize files and folders in another directory on the same system. however, i want to exclude particular files and/or folders when i execute the command. is this possible? if so, can someone please provide a working example?

thanks in advance
 
Old 02-01-2010, 02:49 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,950
Blog Entries: 11

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
Hi, welcome to LQ!

With plain cp: no
With cp and scripting: yes, but cumbersome
Use rsync instead. Despite its name it works quite well
for local copies.


Cheers,
Tink
 
Old 02-01-2010, 03:26 AM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946
For true two-way synchronization, unison is better than rsync. It's relatively easy to use and can be used both cli and through a gui frontend. And yes, it can be set up to exclude specific files and folders.
 
Old 02-03-2010, 03:47 AM   #4
ssisbi
LQ Newbie
 
Registered: Jan 2010
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Tinkster View Post
Hi, welcome to LQ!

With plain cp: no
With cp and scripting: yes, but cumbersome
Use rsync instead. Despite its name it works quite well
for local copies.


Cheers,
Tink
thanks for the welcome.

can you please provide me with an rsync working example?
 
  


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 On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
linux red flag command shell krtek80 Linux - Newbie 1 07-29-2009 03:31 AM
Removing a file named like a command flag yuchai Linux - General 1 07-26-2006 02:32 PM
Flag question of Tar command satimis Linux - General 8 06-28-2005 09:59 AM
Cdrecord - flag question satimis Linux - General 1 05-27-2005 03:49 AM
Basic Question about update-menu -9 command Rjones1981 Linux - Newbie 0 03-10-2004 08:20 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration