my file system looks like:
source/
folder1/
subfolder/
contents
other_subfolders
file1
file2
folder2/
subfolder/
contents
other_subfolders
file1
file2
folder3/
subfolder/
contents
other_subfolders
file1
file2
file1
file2
What I want to copy is pretty much only this:
folder1/
subfolder/
contents
folder2/
subfolder/
contents
folder3/
subfolder/
contents
i.e. I only want to keep
- folder structure
- copy over subfolders with their contents
- ignore any files outside subfolders or any other folders outside subfolders
Currently, I'm trying:
$cd destination
$rsync -atvr --include="*/subfolder/" --exclude="*" source/ .
By putting in --exclude="*"
I hope to exclude everything except what I put in include, which is */subfolder/
, that is, a folder called subfolder being inside any highest-level folder in the source...
However, no files are being ever copied. Why? What am I missing?
I also tried
$cd destination
$rsync -atvr --include="*/subfolder/" --exclude="*/*" source/ .
But that did this:
folder1/
subfolder/
folder2/
subfolder/
folder3/
subfolder/
file1
file2
i.e. kept files in source (outside folders), created the desired subfolders, but did not copy anything inside them.
Edit: at Siva's request, after putting in rsync -av --include='/' --include='/subfolder**' --exclude='*' source/ .
I get:
To access the system:
1) If not using ssh-keys, please enter your TACC password at the password prompt 2) At the TACC Token prompt, enter your 6-digit code followed by .
Password:
TACC Token Code:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "C.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "C.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "C.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "C.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "C.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "C.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "C.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "C.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
receiving incremental file list
./
sent 59 bytes received 104 bytes 10.52 bytes/sec
total size is 3,242 speedup is 19.89
But I promise, all those warnings have nothing to do with the problem at hand and pop up every time I try to access the server in whatever way (ssh, scp, rsync, ...).