[Cialug] Auto create link in a folder

Todd Walton tdwalton at gmail.com
Tue May 19 10:43:23 CDT 2015


Seems like the COW feature of btrfs was made for this sort of thing.
cp --reflink?

(I haven't done this myself.)

--
Todd


On Mon, May 18, 2015 at 6:51 AM, Andrew Denner <linux-list at upeke.com> wrote:

> The other option would be to modify the wordpress php code to perform the
> link when you upload the file (assuming that you are using wordpress to do
> the upload) https://php.net/manual/en/function.symlink.php
>
> On Sun, May 17, 2015 at 11:12 PM, Matthew Nuzum <newz at bearfruit.org>
> wrote:
>
> > Thanks, I will check this unionfs out. I’ve heard of it but haven’t used
> > it, except for the CoW file systems that were popular back in the day of
> > live CDs.
> >
> > Josh, also thanks. Inotify was the search word that would have gotten me
> > to what I was thinking.
> >
> > In the meantime, there is a cron job doing cp -rs at regular intervals.
> > --
> > Matthew Nuzum
> > newz2000 on freenode, skype, linkedin and twitter
> >
> >
> > ♫ You're never fully dressed without a smile! ♫
> >
> > > On May 17, 2015, at 6:24 PM, Pixie <pix at kepibu.org> wrote:
> > >
> > > This sounds like a perfect fit for a union mount for the staging
> > > directory (see unionfs, aufs, overlayfs).
> > >
> > > Something like:
> > >  unionfs-fuse
> > >
> >
> /var/www/staging/wp-content/uploads-real=RW:/var/www/live/wp-content/uploads=RO
> > > /var/www/staging/wp-content/uploads
> > >
> > > (overlayfs may make more sense, depending on your kernel version.)
> > >
> > >
> > >
> > > On 2015.05.17 16:23, Matthew Nuzum wrote:
> > >> I have a live wordpress site and a staging wordpress site. I have a
> > >> job that can periodically copy the live site over to staging to keep
> > >> the test site relatively up to date. However, this site deals with
> > >> large files and it is wasteful to keep a duplicate copy of them on
> > >> the same drive.
> > >>
> > >> What I’d like to do is create a link for the files in the live site
> > >> over to staging whenever it is created. I don’t care if the links are
> > >> soft or hard. For example,
> > >>
> > >> If a file is created in /var/www/live/wp-content/uploads
> > >> automatically create a link to it in
> > >> /var/www/staging/wp-content/uploads.
> > >>
> > >> I can create a batch job that does this every so often, but is there
> > >> an easy way to have it happen automatically? I seem to remember a
> > >> service that will watch file for file modifications and do something
> > >> on demand. That seems like an efficient way to do it. I was thinking
> > >> the service was called iwatch or similar, but searching for that only
> > >> shows me stuff about the Apple Watch.
> > >>
> > >> Here’s what I don’t want to do: I don’t want to symlink the uploads
> > >> folder. I want to be able to upload files to staging without them
> > >> going to live.
> > >>
> > >
> > > _______________________________________________
> > > Cialug mailing list
> > > Cialug at cialug.org
> > > http://cialug.org/mailman/listinfo/cialug
> >
> > _______________________________________________
> > Cialug mailing list
> > Cialug at cialug.org
> > http://cialug.org/mailman/listinfo/cialug
> >
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug
>


More information about the Cialug mailing list