Exclude txt file in rsync


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Exclude txt file in rsync
# 1  
Old 10-17-2014
Debian Exclude txt file in rsync

Hi Folks,
I'm using rsync on Solaris 10 to backup a web server and need to exclude the cache and tmp directories. The man pages and google on rsync --exclude are ambiguous but I have tried
Code:
--exclude=".*" and --exclude/remote_server/absolute_path

with success only on the tmp files.
Rather than make the rsync script get messy and difficult to audit with multiple exclusion statements, can I put all the exclusions in a single text file on the source volume file and point the script at that file? If so, how would that be entered?
Thank you for any help with this.
Phil
# 2  
Old 10-17-2014
Following excerpt from the rsync manpage might help:
Code:
       --exclude-from=FILE
              This option is related to the --exclude option, but it specifies
              a FILE that contains exclude patterns  (one  per  line).   Blank
              lines  in  the  file  and  lines  starting  with  ’;’ or ’#’ are
              ignored.  If FILE is -, the list  will  be  read  from  standard
              input.

---------- Post updated at 07:30 PM ---------- Previous update was at 07:14 PM ----------

--exclude=".*" covers hidden files only. You'll need --exclude ".*/" for hidden directories.
# 3  
Old 10-17-2014
@junior_helper: thank you, but I read that. Perhaps I should have noted that the rsync scripts are a "pull" from the backup server. The txt file referenced above works if your script is a "push". Where my confusion is not what the exclusion file contains, but its actual location and position within the script.
Thank you.
Phil
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Rsync Error: rsync: link_stat failed: No such file or directory (2)

I wish to copy all the files & folder under /web/Transfer_Files/data/ on mymac1 (Linux) to remote server mybank.intra.com (Solaris 10) /tmp/ location I am using Ansible tool synchronize module which triggers the unix rsync command as below:rsync --delay-updates -F --compress --archive --rsh=ssh... (2 Replies)
Discussion started by: mohtashims
2 Replies

2. Shell Programming and Scripting

Rsync exclude & include?

hi I have a few folders and a few files , for example Directory A B C D E Files 1 2 3 4 5 I want B directory and "2" File that does not sync But other directories and file sync What is the solution ? Is there a way to sync time is under one minute? os centos 6.8 thanks... (5 Replies)
Discussion started by: mnnn
5 Replies

3. Shell Programming and Scripting

Desired output.txt for reading txt file using awk?

Dear all, I have a huge txt file (DATA.txt) with the following content . From this txt file, I want the following output using some shell script. Any help is greatly appreciated. Greetings, emily DATA.txt (snippet of the huge text file) 407202849... (2 Replies)
Discussion started by: emily
2 Replies

4. Shell Programming and Scripting

Little help with rsync --exclude

Loving the rsync command and beginning to write some scripts with it. However I'm hung up on the --exclude function. Script is tested and works great BEFORE I put the --omit in. What am I doing wrong in my syntax? rsync $OPTS /cis/cloverleaf/cis6.0/integrator/... (2 Replies)
Discussion started by: B_ROX
2 Replies

5. Ubuntu

[Solved] Using Find with an exclude/exclude file

I am familiar with using tar and exclude/include files: tar zcf backup.dirs.tgz --files-from=include.mydirs --exclude-from=exclude.mydirs --no-recursion but was wondering if I could use find in the same way. I know that you can just specify the directories to exclude but my list is... (2 Replies)
Discussion started by: metallica1973
2 Replies

6. Shell Programming and Scripting

awk append fileA.txt to growing file B.txt

This is appending a column. My question is fairly simple. I have a program generating data in a form like so: 1 20 2 22 3 23 4 12 5 43 For ever iteration I'm generating this data. I have the basic idea with cut -f 2 fileA.txt | paste -d >> FileB.txt ???? I want FileB.txt to grow, and... (4 Replies)
Discussion started by: theawknewbie
4 Replies

7. Shell Programming and Scripting

rsync exclude option

Hi Frdz, i am using rsync to transfer files from source to destination. but i have one criteria like i have to tranfer only links from source to destination. in home/test/po folder i have kiran/test1 -> /home/test/lo/fg kiran/test2 -> /home/test/lo/fg2 like links are available.... (1 Reply)
Discussion started by: KiranKumarKarre
1 Replies

8. Shell Programming and Scripting

rsync - exclude statement not working

hey all, i'm trying to rsync some dir's and files between servers and i've added an exclude statement, but it still goes out and tries to rsync the directory. I've tried the following: --exclude="/export/home/zones/lab" as well as: --exclude=/export/home/zones/lab and also:... (1 Reply)
Discussion started by: em23
1 Replies

9. UNIX for Dummies Questions & Answers

Binary txt file received when i use uuencode to send txt file as attachment

Hi, I have already read a lot of posts on sending attachments in unix...but none of them were of help for my problem...so here goes.. i wanna attach a text file and send to a mail id..used the following code : uuencode "$File1" "$File1" ;|mail -s "$Mail_sub" abc@abc.com it works... (2 Replies)
Discussion started by: ash22
2 Replies

10. Shell Programming and Scripting

Creating and using a /.rsync/exclude

Hello all, Everyone has been awesome assisting with my rsync script... Now I want to clean it up. I think the best way for me to exclude many files might be to use a rsync exclude file. So in my script I add So now then, here is my .rsync/exclude... So what is happening is the... (0 Replies)
Discussion started by: komputersman
0 Replies
Login or Register to Ask a Question