[Cialug] Auto create link in a folder

Matthew Nuzum newz at bearfruit.org
Sun May 17 16:23:44 CDT 2015


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.

-- 
Matthew Nuzum
newz2000 on freenode, skype, linkedin and twitter


♫ You're never fully dressed without a smile! ♫




More information about the Cialug mailing list