Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8047287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:03:21+00:00 2026-06-05T06:03:21+00:00

I have a folder named images on my linux box. This folder is connected

  • 0

I have a folder named images on my linux box.
This folder is connected to a website and the admin of the site has the ability to add pictures to this site. However, when a picture is added, I want a command to run resizing all of the pictures a directory.

In short, I want to know how I can make the server run a specific command when a new file is added to a specific location.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T06:03:23+00:00Added an answer on June 5, 2026 at 6:03 am

    I don’t know how people are uploading content to this folder, but you might want to use something lower-tech than monitoring the directory with inotify.

    If the protocol is FTP and you have access to your FTP server’s log, I suggest tailing that log to watch for successful uploads. This sort of event-triggered approach will be faster, more reliable, and less load than a polling approach with traditional cron, and more portable and easier to debug than something using inotify.

    The way you handle this will of course depend on your FTP server. I have one running vsftpd whose logs include lines like this:

    Fri May 25 07:36:02 2012 [pid 94378] [joe] OK LOGIN: Client "10.8.7.16"
    Fri May 25 07:36:12 2012 [pid 94380] [joe] OK UPLOAD: Client "10.8.7.16", "/path/to/file.zip", 8395136 bytes, 845.75Kbyte/sec
    Fri May 25 07:36:12 2012 [pid 94380] [joe] OK CHMOD: Client "10.8.7.16", "/path/to/file.zip 644"
    

    The UPLOAD line only gets added when vsftpd has successfully saved the file. You could parse this in a shell script like this:

    #!/bin/sh
    
    tail -F /var/log/vsftpd.log | while read line; do
      if echo "$line" | grep -q 'OK UPLOAD:'; then
        filename=$(echo "$line" | cut -d, -f2)
        if [ -s "$filename" ]; then
          # do something with $filename
        fi
      fi
    done
    

    If you’re using an HTTP upload tool, see if that tool has a text log file it uses to record incoming files. If it doesn’t consider adding some sort of logger function to it, so it’ll produce logs that you can tail.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a folder named repository in my admin folders. This folder holds 2
I have a folder named Common/Images/Photounavailable.jpg . Is this right way of refering to
I have a folder full of 2000 images, all unique and named like this:
In my php project I have a folder named Gallery1 (path is images/gallery1). Which
I have a /Documents/Images folder , in that folder are several other folders named
I have created a new folder in my project, aptly named 'images'. I have
I have one folder named Images in my project. I want to get the
I have a folder named import at my root directory where the public folder
I have a folder in my app named Files. I would like to display
I have a content folder which is full of other sub-directories named in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.