LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 03-06-2022, 04:41 AM   #1
Tyro65
Member
 
Registered: Jul 2009
Location: Sault Ste. Marie, ON
Distribution: MX-21
Posts: 55

Rep: Reputation: 0
how to exclude directories in grsync


Will the following work to exclude directories?

In Grsync's Advanaced Options, I have entered the command:
--exclude-from="/home/stan/.grsync/exclude.txt"

My file, exclude.txt, contains:
dev
.cache
proc
sys
media
mnt
run
tmp
home/stan/Downloads
home/stan/Documents/ArcaNoae
home/stan/Pictures
home/stan/snap
home/stan/VirtualBox VMs

Thank you for your help.
 
Old 03-07-2022, 02:31 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,039

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
you can definitely try it, but without other setting/arguments it is meaningless.
You can always try dry-run to check your option(s) without actually executing rsync
 
1 members found this post helpful.
Old 03-08-2022, 10:16 AM   #3
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
When using rsync I have found that the excludes always seem by default to require a path relative to the starting folder. Thus in your case, if you are in your home folder which appears to be /home/stan the parts in the exclude.txt file that begin with '/home/stan/' may need that leading part to be removed. Otherwise it should work, and as stated you can do a dry run to test it.
 
1 members found this post helpful.
Old 03-08-2022, 04:38 PM   #4
Tyro65
Member
 
Registered: Jul 2009
Location: Sault Ste. Marie, ON
Distribution: MX-21
Posts: 55

Original Poster
Rep: Reputation: 0
It's sounds like I'm not AWAY off track, so --yes-- I'll keep trying.
You'll get a chuckle out of this one: In one of my tries, grsync copied only the directories that were listed in my "exclude" file. I wish I had made note of what I did in that one.
 
  


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] Exclude all hidden files except a few with Grsync. linustalman Linux - Networking 10 05-10-2014 01:08 PM
Can we use exclude option in"rm" command to exclude some files/folders? yadav_rk727 Linux - Newbie 1 02-03-2010 10:14 AM
CVS Exclude : Exclude sub directories from check out On Linux from command line shajay12 Linux - Newbie 1 08-03-2009 12:36 AM
tar --exclude --exclude-from cefn Linux - Software 4 10-11-2005 07:31 PM

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

All times are GMT -5. The time now is 04:01 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