incron speed problem
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 1 of 1
  1. #1
    Join Date
    May 2009
    Posts
    464
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    incron speed problem

    I was using incron on a very fast virtual server.
    The script called by incron was actually kicked off faster than the file system shows it.

    I had to add a "sleep 2" before the test for the file.

    Further notes on this speed issue: If you are using significant files coming in via (s)ftp, you might find your program/script picking up the file before it is there
    - I put in a little sleep look to make sure the file is not growing. Sample bash code (CheckSize) below.



    Bail() { # simple version fro illustration only
    echo $*
    exit 1
    }

    CheckSize() { # incron is fast, we need the whole file not part
    if [ "$1" = "" ]; then Bail "$MYNAMEheckSize requires a parameter"; fi
    if [ ! -f $1 ]; then sleep 2; fi
    if [ ! -f $1 ]; then Bail cannot find file $1; fi
    while [ true ] # make sure we got the whole file from ftp
    do
    ORIGSIZE=`ls -l $1 2> /dev/null | awk '{print $5}'`
    sleep 10
    CURRSIZE=`ls -l $1 2> /dev/null | awk '{print $5}'`
    if [ "$CURRSIZE" = "$ORIGSIZE" ]; then break; fi
    done
    }

    Nice but not expected. ;=\
    Last edited by rholme; 16th June 2019 at 12:53 PM.

Similar Threads

  1. Slow download speed, Fast upload speed
    By rudedog830 in forum Servers & Networking
    Replies: 8
    Last Post: 12th September 2014, 04:34 PM
  2. SMB | Speed Problem
    By M.e.M.O. in forum Servers & Networking
    Replies: 7
    Last Post: 21st January 2013, 10:13 AM
  3. Speed CPU fan problem
    By rakon82 in forum Using Fedora
    Replies: 6
    Last Post: 11th March 2011, 12:00 AM
  4. incron/inotify and fuse
    By orrorin in forum Using Fedora
    Replies: 4
    Last Post: 6th March 2009, 02:03 PM
  5. dvd speed problem
    By jeff_s in forum Hardware & Laptops
    Replies: 3
    Last Post: 22nd June 2005, 04:03 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •