As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/

A (hopefully) simple task for a Linux box

FeralFeral MEMETICHARIZARDinterior crocodile alligator ⇔ ǝɹʇɐǝɥʇ ǝᴉʌoɯ ʇǝloɹʌǝɥɔ ɐ ǝʌᴉɹp ᴉRegistered User regular
edited December 2011 in Help / Advice Forum
I have a very simple task that I need to do. I have a Linux box (Debian, specifically) and I want it to watch a shared folder on a Windows server and, whenever a new file is uploaded to that folder, copy that file to a local folder.

A straight synchronization won't work as I don't want changes to be replicated back to the source folder (it's a one-way copy) and I don't want it to repeat copying a file that is deleted from the destination.

In other words, if somebody copies a file to \\windows\shared\watchme, that file needs to be copied over, one time to /home/debian/whatever. Then it will be altered or deleted on the Debian box, with no changes to the original.

If push comes to shove, I can write a PERL script that will do it, and schedule it as cron job to run every 5m. However, that's clumsy, and I'd like to know if there's a more elegant way to do it.

every person who doesn't like an acquired taste always seems to think everyone who likes it is faking it. it should be an official fallacy.
the "no true scotch man" fallacy.
Feral on

Posts

  • DemerdarDemerdar Registered User regular
    I really can't think of a simple alternative to checking the directory every few minutes for any changes and to copy any new files over.

    y6GGs3o.gif
  • SeñorAmorSeñorAmor !!! Registered User regular
    What about scheduling rsync with a cron job?

  • FeralFeral MEMETICHARIZARD interior crocodile alligator ⇔ ǝɹʇɐǝɥʇ ǝᴉʌoɯ ʇǝloɹʌǝɥɔ ɐ ǝʌᴉɹp ᴉRegistered User regular
    @SeñorAmor - I'll look into that! Thanks!

    every person who doesn't like an acquired taste always seems to think everyone who likes it is faking it. it should be an official fallacy.
    the "no true scotch man" fallacy.
Sign In or Register to comment.