Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 293051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:14:10+00:00 2026-05-12T06:14:10+00:00

I have a dir with files and dirs in it. What I want is

  • 0

I have a dir with files and dirs in it. What I want is to make rsync copy of several folders from that dir. For example, lets say I have this:

/home/user
-- drwxr-xr-x  folderA
-- drwxr-xr-x  folderB
-- drwxr-xr-x  folderC
-- -rw-r--r--  file.1
-- -rw-r--r--  file.2

I want to copy folderA and folerB using rsync. I have created file rsync_folders.txt

+ /folderA/**
+ /folderB/**

My problem is that rsync will always copy file unless it matches exclude pattern. But if I add

- /**

nothing is copied because rsync first matches against exclude patterns.

Any ideas?

Note: I cannot list all folders and files I want to exclude. It will be changing from time to time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T06:14:11+00:00Added an answer on May 12, 2026 at 6:14 am

    Either use rsync -av src1 src2 src3 ... dst or put all the folders you want to rsync in a text file (each folder in a separate line) and use rsync -arv --files-from=sources.txt dst.
    Note that by default -a implies --recursive but not when --files-from is used, so in this case -r must be specified explicitly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have this url: http://site.example/dir/ In this folder I have these files: test.ascx.cs
After downloading files from a remote UNIX FTP server, you want to verify that
I have several backup dirs I want to put them into git. The dirs
I have a PHP script that executes a .bat file using system(cmd /c C:\dir\file.bat);
I have a directory Dir in which I have about 30 sub-directories. From these
I have a script that will walk a system directory, and get the files
I have an array of directory paths, and want to get all string[] dirs
I have this code that should open and read two text files, and match
I have a folder with ten files in it which I want to loop
I have the code like below: temp = os.walk(sys.argv[1]) for root, dirs, files in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.