Mount and merge folder contents
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
Is there any way to mount a folder content inside to another one?
Let's say I have 2 folders with following content;
Folder1 Folder2
file1 file2
I basically want to make visible all of the content of Folder2 in Folder1. So the new content should be like this;
Folder1 Folder2
file1 file2
file2
And I also want Folder1 content to be updated when I do any change in Folder2. Let's say I've created file3 in Folder2. I'm expecting to see the new file under both of them.
Folder1 Folder2
file1 file2
file2 file3
file3
So the general rules should be;
- If you create/delete/modify any file under Folder2, it will be also visible under Folder1.
- If you create/delete/modify any file in Folder 1 (which belongs to Folder2, for example removing file2), those changes will be done in Folder2.
- User should not see any content of Folder1 under Folder2.
Any solution for that kind of requirement?
Thanks.
mount merge
add a comment |Â
up vote
0
down vote
favorite
Is there any way to mount a folder content inside to another one?
Let's say I have 2 folders with following content;
Folder1 Folder2
file1 file2
I basically want to make visible all of the content of Folder2 in Folder1. So the new content should be like this;
Folder1 Folder2
file1 file2
file2
And I also want Folder1 content to be updated when I do any change in Folder2. Let's say I've created file3 in Folder2. I'm expecting to see the new file under both of them.
Folder1 Folder2
file1 file2
file2 file3
file3
So the general rules should be;
- If you create/delete/modify any file under Folder2, it will be also visible under Folder1.
- If you create/delete/modify any file in Folder 1 (which belongs to Folder2, for example removing file2), those changes will be done in Folder2.
- User should not see any content of Folder1 under Folder2.
Any solution for that kind of requirement?
Thanks.
mount merge
Why would one want to do this? It looks messy.
â dr01
May 3 at 13:42
For upstart conf files. I want to keep /etc/init tidy, so if I can do it, Folder1 will be /etc/init, and Folder2 will be my own service file folder which can reside anywhere in the system.
â benjamin button
May 3 at 14:01
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Is there any way to mount a folder content inside to another one?
Let's say I have 2 folders with following content;
Folder1 Folder2
file1 file2
I basically want to make visible all of the content of Folder2 in Folder1. So the new content should be like this;
Folder1 Folder2
file1 file2
file2
And I also want Folder1 content to be updated when I do any change in Folder2. Let's say I've created file3 in Folder2. I'm expecting to see the new file under both of them.
Folder1 Folder2
file1 file2
file2 file3
file3
So the general rules should be;
- If you create/delete/modify any file under Folder2, it will be also visible under Folder1.
- If you create/delete/modify any file in Folder 1 (which belongs to Folder2, for example removing file2), those changes will be done in Folder2.
- User should not see any content of Folder1 under Folder2.
Any solution for that kind of requirement?
Thanks.
mount merge
Is there any way to mount a folder content inside to another one?
Let's say I have 2 folders with following content;
Folder1 Folder2
file1 file2
I basically want to make visible all of the content of Folder2 in Folder1. So the new content should be like this;
Folder1 Folder2
file1 file2
file2
And I also want Folder1 content to be updated when I do any change in Folder2. Let's say I've created file3 in Folder2. I'm expecting to see the new file under both of them.
Folder1 Folder2
file1 file2
file2 file3
file3
So the general rules should be;
- If you create/delete/modify any file under Folder2, it will be also visible under Folder1.
- If you create/delete/modify any file in Folder 1 (which belongs to Folder2, for example removing file2), those changes will be done in Folder2.
- User should not see any content of Folder1 under Folder2.
Any solution for that kind of requirement?
Thanks.
mount merge
asked May 3 at 13:28
benjamin button
85
85
Why would one want to do this? It looks messy.
â dr01
May 3 at 13:42
For upstart conf files. I want to keep /etc/init tidy, so if I can do it, Folder1 will be /etc/init, and Folder2 will be my own service file folder which can reside anywhere in the system.
â benjamin button
May 3 at 14:01
add a comment |Â
Why would one want to do this? It looks messy.
â dr01
May 3 at 13:42
For upstart conf files. I want to keep /etc/init tidy, so if I can do it, Folder1 will be /etc/init, and Folder2 will be my own service file folder which can reside anywhere in the system.
â benjamin button
May 3 at 14:01
Why would one want to do this? It looks messy.
â dr01
May 3 at 13:42
Why would one want to do this? It looks messy.
â dr01
May 3 at 13:42
For upstart conf files. I want to keep /etc/init tidy, so if I can do it, Folder1 will be /etc/init, and Folder2 will be my own service file folder which can reside anywhere in the system.
â benjamin button
May 3 at 14:01
For upstart conf files. I want to keep /etc/init tidy, so if I can do it, Folder1 will be /etc/init, and Folder2 will be my own service file folder which can reside anywhere in the system.
â benjamin button
May 3 at 14:01
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
I'm not aware of anyway to directly do what you're asking, and you would of course encounter issues if file1
existed in both folder1
and folder2
.
You could create links from each file/directory under folder2
to folder1
, this would require a link per file/directory under folder2
. You could create a script to keep the links updated and remove dead links.
If you used hard links then this would all be seamless when doing a directory listing etc.
You could then use inotify
to watch folder1
and folder2
to trigger the creation/deletion of the hard links.
Creating another controller service is what I'm trying to escape, such as writing script. If I can mount the content of the folder2 into the folder1, and make it permanent, then there won't be any necessity to create a control mechanism.
â benjamin button
May 4 at 10:33
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
I'm not aware of anyway to directly do what you're asking, and you would of course encounter issues if file1
existed in both folder1
and folder2
.
You could create links from each file/directory under folder2
to folder1
, this would require a link per file/directory under folder2
. You could create a script to keep the links updated and remove dead links.
If you used hard links then this would all be seamless when doing a directory listing etc.
You could then use inotify
to watch folder1
and folder2
to trigger the creation/deletion of the hard links.
Creating another controller service is what I'm trying to escape, such as writing script. If I can mount the content of the folder2 into the folder1, and make it permanent, then there won't be any necessity to create a control mechanism.
â benjamin button
May 4 at 10:33
add a comment |Â
up vote
0
down vote
I'm not aware of anyway to directly do what you're asking, and you would of course encounter issues if file1
existed in both folder1
and folder2
.
You could create links from each file/directory under folder2
to folder1
, this would require a link per file/directory under folder2
. You could create a script to keep the links updated and remove dead links.
If you used hard links then this would all be seamless when doing a directory listing etc.
You could then use inotify
to watch folder1
and folder2
to trigger the creation/deletion of the hard links.
Creating another controller service is what I'm trying to escape, such as writing script. If I can mount the content of the folder2 into the folder1, and make it permanent, then there won't be any necessity to create a control mechanism.
â benjamin button
May 4 at 10:33
add a comment |Â
up vote
0
down vote
up vote
0
down vote
I'm not aware of anyway to directly do what you're asking, and you would of course encounter issues if file1
existed in both folder1
and folder2
.
You could create links from each file/directory under folder2
to folder1
, this would require a link per file/directory under folder2
. You could create a script to keep the links updated and remove dead links.
If you used hard links then this would all be seamless when doing a directory listing etc.
You could then use inotify
to watch folder1
and folder2
to trigger the creation/deletion of the hard links.
I'm not aware of anyway to directly do what you're asking, and you would of course encounter issues if file1
existed in both folder1
and folder2
.
You could create links from each file/directory under folder2
to folder1
, this would require a link per file/directory under folder2
. You could create a script to keep the links updated and remove dead links.
If you used hard links then this would all be seamless when doing a directory listing etc.
You could then use inotify
to watch folder1
and folder2
to trigger the creation/deletion of the hard links.
answered May 3 at 14:51
rusty shackleford
1,145115
1,145115
Creating another controller service is what I'm trying to escape, such as writing script. If I can mount the content of the folder2 into the folder1, and make it permanent, then there won't be any necessity to create a control mechanism.
â benjamin button
May 4 at 10:33
add a comment |Â
Creating another controller service is what I'm trying to escape, such as writing script. If I can mount the content of the folder2 into the folder1, and make it permanent, then there won't be any necessity to create a control mechanism.
â benjamin button
May 4 at 10:33
Creating another controller service is what I'm trying to escape, such as writing script. If I can mount the content of the folder2 into the folder1, and make it permanent, then there won't be any necessity to create a control mechanism.
â benjamin button
May 4 at 10:33
Creating another controller service is what I'm trying to escape, such as writing script. If I can mount the content of the folder2 into the folder1, and make it permanent, then there won't be any necessity to create a control mechanism.
â benjamin button
May 4 at 10:33
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f441554%2fmount-and-merge-folder-contents%23new-answer', 'question_page');
);
Post as a guest
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
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
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
Why would one want to do this? It looks messy.
â dr01
May 3 at 13:42
For upstart conf files. I want to keep /etc/init tidy, so if I can do it, Folder1 will be /etc/init, and Folder2 will be my own service file folder which can reside anywhere in the system.
â benjamin button
May 3 at 14:01