LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 09-28-2008, 01:16 PM   #1
Meson
Member
 
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Rep: Reputation: 67
cp -al dir1/ dir2/ but skip some dir1/subdir


I want to start taking snapshots of my home directory using the cp command with hardlinks. However I don't want to include EVERYTHING. For example

Code:
$ cp -al ~/.mozilla/ backupdir/
$ rm -fr backupdir/.mozilla/myprofile/Cache
I don't want to be snapshotting the cache because I think this could make them become very inefficient.

Does anyone have a better idea of how to do this without a cp and then rm?
 
Old 09-28-2008, 01:39 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,340

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
I use the cpbk command to do do backups which exclude part of the file tree. cpbk is very similiar to the cp command with the addition that cpbk has a control file in which you can exclude or include parts of your file tree. cpbk is no longer maintained so I keep using my old tar.gz for cpbk and compile it on each new system that I install.

You can get the latest tar.gz for cpbk here:

http://ftp.nluug.nl/pub/os/Linux/dis...l/main/c/cpbk/

----------------
Steve Stites
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
BASH SHELL , how to copy all file in dir1 to dir3 CheeSen Programming 15 11-02-2008 06:11 AM
Is `mv dir dir2` atomic ? meili100 Linux - Software 9 02-27-2008 06:24 PM
Kernel in subdir of /boot hepburnenthorpe Debian 16 01-07-2008 03:57 PM
how many files on a subdir ? graziano1968 Linux - General 2 08-09-2006 11:18 PM
make a file in dir1 appear to be in writeprotected dir2 magicpio Linux - Newbie 2 09-25-2005 01:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:11 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
Open Source Consulting | Domain Registration