将文件从一个文件夹投影到另一个文件夹

时间:2022-01-26 06:50:18

I would like to have a part of apache configs in my local folder.

我想在我的本地文件夹中有一部分apache配置。

It's necessary to automate subdomains creation.

有必要自动创建子域。

Is it possible to project all files from my local folder into /etc/apche2/sites-available/ folder under the Debian linux?

是否可以将我本地文件夹中的所有文件投影到Debian linux下的/ etc / apche2 / sites-available /文件夹中?

I. e. don't create symbolic link for a every new file, but just make somthing simple 8-)

I. e。不要为每个新文件创建符号链接,只是让事情变得简单8-)

It's must be looked like that:

它必须看起来像那样:

LOCAL FOLDER                           SITES-AVAILABLE

f1.conf                                s-a1.conf
f2.conf                                s-a2.conf
f3.conf                                s-a3.conf
                                       f1.conf
                                       f2.conf
                                       f3.conf

Thanks in advance!

1 个解决方案

#1


From man mount:

从man mount:

mount --bind olddir newdir

mount --bind olddir newdir

After this call the same contents are accessible in two places. One can also remount a single file (on a single file).

在此调用之后,可以在两个位置访问相同的内容。还可以重新安装单个文件(在单个文件上)。

In your case it would be:

在你的情况下,它将是:

sudo mount --bind /etc/apche2/sites-available/ ~/my/local/folder/

Make sure ~/my/local/folder/ is empty before you do mount.

在安装之前确保〜/ my / local / folder /为空。

#1


From man mount:

从man mount:

mount --bind olddir newdir

mount --bind olddir newdir

After this call the same contents are accessible in two places. One can also remount a single file (on a single file).

在此调用之后,可以在两个位置访问相同的内容。还可以重新安装单个文件(在单个文件上)。

In your case it would be:

在你的情况下,它将是:

sudo mount --bind /etc/apche2/sites-available/ ~/my/local/folder/

Make sure ~/my/local/folder/ is empty before you do mount.

在安装之前确保〜/ my / local / folder /为空。