rsync subfolder to different folder nameUsing rsync to move (not copy) files between directories?rsync,...
Lead the way to this Literary Knight to its final “DESTINATION”
How can the US president give an order to a civilian?
Why is Skinner so awkward in Hot Fuzz?
Having some issue with notation in a Hilbert space
Class to generate a pdf invoice
Is swap gate equivalent to just exchanging the wire of the two qubits?
Basic power tool set for Home repair and simple projects
Leveraging cash for buying car
How "fast" does astronomical events happen?
What could be the physiological mechanism for a biological Geiger counter?
How do credit card companies know what type of business I'm paying for?
Redirecting output only on a successful command call
How to search for Android apps without ads?
Numerical second order differentiation
Digital signature that is only verifiable by one specific person
Leaving job close to major deadlines
Is there a term for someone whose preferred policies are a mix of Left and Right?
New Site Design!
Co-worker is now managing my team. Does this mean that I'm being demoted?
Does knowing the surface area of all faces uniquely determine a tetrahedron?
What do I put on my resume to make the company i'm applying to think i'm mature enough to handle a job?
Someone who is granted access to information but not expected to read it
Is it possible for underground bunkers on different continents to be connected?
Does anyone recognize these rockets, and their location?
rsync subfolder to different folder name
Using rsync to move (not copy) files between directories?rsync, delete files on receiving side that were deleted on sending side. (But don't delete everything)Apply given rsync exclude patterns on given directoryCan rsync be configured to avoid modifying subdirectories not found in the source folder?Rsync folder while --exclude-from'ing .gitignore files at different depthsrsync + chmod only selected filesHow does the --fuzzy option for rsync work?Can rsync copy directories over linksrsync --delete with superset destination folderHow to make rsync delete directories from destination that are not in the source list
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
When I do this:
rsync folder/a /mnt/some/destination
I end up with /mnt/some/destination/folder/a, but what I want is for the contents of folder/a to be directly inside /mnt/some/destination.
I know this is possible if I do this:
rsync folder/a/* /mnt/some/destination
However, and this is the key to the issue, is that this doesn't work with the --delete option. That option requires the source to be a directory, so the wildcard doesn't work.
A workaround would be to
cd folder/a && rsync --delete . /mnt/some/destination
Is there a way to do this without changing the working directory? My scenario is CD/CI build environment.
Are there any options like the tar -C, or wget --cut-dirs?
rsync
add a comment |
When I do this:
rsync folder/a /mnt/some/destination
I end up with /mnt/some/destination/folder/a, but what I want is for the contents of folder/a to be directly inside /mnt/some/destination.
I know this is possible if I do this:
rsync folder/a/* /mnt/some/destination
However, and this is the key to the issue, is that this doesn't work with the --delete option. That option requires the source to be a directory, so the wildcard doesn't work.
A workaround would be to
cd folder/a && rsync --delete . /mnt/some/destination
Is there a way to do this without changing the working directory? My scenario is CD/CI build environment.
Are there any options like the tar -C, or wget --cut-dirs?
rsync
add a comment |
When I do this:
rsync folder/a /mnt/some/destination
I end up with /mnt/some/destination/folder/a, but what I want is for the contents of folder/a to be directly inside /mnt/some/destination.
I know this is possible if I do this:
rsync folder/a/* /mnt/some/destination
However, and this is the key to the issue, is that this doesn't work with the --delete option. That option requires the source to be a directory, so the wildcard doesn't work.
A workaround would be to
cd folder/a && rsync --delete . /mnt/some/destination
Is there a way to do this without changing the working directory? My scenario is CD/CI build environment.
Are there any options like the tar -C, or wget --cut-dirs?
rsync
When I do this:
rsync folder/a /mnt/some/destination
I end up with /mnt/some/destination/folder/a, but what I want is for the contents of folder/a to be directly inside /mnt/some/destination.
I know this is possible if I do this:
rsync folder/a/* /mnt/some/destination
However, and this is the key to the issue, is that this doesn't work with the --delete option. That option requires the source to be a directory, so the wildcard doesn't work.
A workaround would be to
cd folder/a && rsync --delete . /mnt/some/destination
Is there a way to do this without changing the working directory? My scenario is CD/CI build environment.
Are there any options like the tar -C, or wget --cut-dirs?
rsync
rsync
asked 47 mins ago
SarkeSarke
215125
215125
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Instead of:
rsync folder/a /mnt/some/destination
use:
rsync folder/a/ /mnt/some/destination
That will allow --delete to delete files in the destination that don't exist in the source and also puts the contents of folder/a directly into /mnt/some/destination/.
Ah, it's those little details! Thanks!
– Sarke
24 mins ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f525052%2frsync-subfolder-to-different-folder-name%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Instead of:
rsync folder/a /mnt/some/destination
use:
rsync folder/a/ /mnt/some/destination
That will allow --delete to delete files in the destination that don't exist in the source and also puts the contents of folder/a directly into /mnt/some/destination/.
Ah, it's those little details! Thanks!
– Sarke
24 mins ago
add a comment |
Instead of:
rsync folder/a /mnt/some/destination
use:
rsync folder/a/ /mnt/some/destination
That will allow --delete to delete files in the destination that don't exist in the source and also puts the contents of folder/a directly into /mnt/some/destination/.
Ah, it's those little details! Thanks!
– Sarke
24 mins ago
add a comment |
Instead of:
rsync folder/a /mnt/some/destination
use:
rsync folder/a/ /mnt/some/destination
That will allow --delete to delete files in the destination that don't exist in the source and also puts the contents of folder/a directly into /mnt/some/destination/.
Instead of:
rsync folder/a /mnt/some/destination
use:
rsync folder/a/ /mnt/some/destination
That will allow --delete to delete files in the destination that don't exist in the source and also puts the contents of folder/a directly into /mnt/some/destination/.
answered 42 mins ago
Jeff Schaller♦Jeff Schaller
46.9k1167152
46.9k1167152
Ah, it's those little details! Thanks!
– Sarke
24 mins ago
add a comment |
Ah, it's those little details! Thanks!
– Sarke
24 mins ago
Ah, it's those little details! Thanks!
– Sarke
24 mins ago
Ah, it's those little details! Thanks!
– Sarke
24 mins ago
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f525052%2frsync-subfolder-to-different-folder-name%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown