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

  • Home
  • SEARCH
  • 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 8767199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:44:59+00:00 2026-06-13T16:44:59+00:00

I have cron SHELL=/bin/bash PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin * * * * * root /usr/bin/flock -xn /var/lock/script.lock

  • 0

I have cron

SHELL=/bin/bash

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

* * * * * root  /usr/bin/flock -xn /var/lock/script.lock -c '/bin/bash /root/Dropbox/1.sh'

my 1.sh

#!/bin/bash -l 

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 

x=1
while [ $x -le 3 ] 
do 
URL=$(head -n 1 /root/Dropbox/query.txt) 
lynx -dump  $URL | egrep '^http' > /root/Dropbox/urls.txt 
x=$(( $x + 1 )) 
done

Bash as default

# echo $SHELL

/bin/bash

Why cron doesn’t run 1.sh ?

  • 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-13T16:45:00+00:00Added an answer on June 13, 2026 at 4:45 pm

    remove “root” in line crontab line:

    * * * * * /usr/bin/flock -xn /var/lock/script.lock -c '/bin/bash /root/Dropbox/1.sh'
    

    If you need root rights put in crontab of root user.
    With “root” you will also find error in syslog or messages logs.

    And of course be sure the cron daemon is running: ps -ef | grep cron

    ADD:
    I’ve tested it with simple touch a file (on ubuntu):
    contab line:

    * * * * * /usr/bin/flock -xn /var/lock/script.lock -c '/bin/bash ~/1.sh'
    

    1.sh:

    #!/bin/bash
    touch /tmp/hallo
    

    ADD: (looking at lynx command)
    A version of 1.sh Script it works for me.

    #!/bin/bash
    
    x=1
    while [ $x -le 3 ]
    do
    URL="http://www.subir.com/lynx.html"
    lynx -dump  $URL | egrep '.*\. http' > urls.txt
    x=$(( $x + 1 ))
    done
    

    I changed the regEx on egrep. Your output of lynx may be different (other version of lynx). And I used a fixed test URL (lynx man page). The urls.txt will be filled. Script is triggered by cron. The while will have no effect noting in loop logic will be change on next run.

    stephan@coppi:~$ more urls.txt 
       1. http://lynx.isc.org/current/index.html
       2. http://lynx.isc.org/current/lynx2-8-8/lynx_help/lynx_help_main.html
       3. http://lynx.isc.org/current/lynx2-8-8/lynx_help/Lynx_users_guide.html
       4. http://lynx.isc.org/lynx2.8.7/index.html
       5. http://lynx.isc.org/lynx2.8.7/lynx2-8-7/lynx_help/lynx_help_main.html
       6. http://lynx.isc.org/lynx2.8.7/lynx2-8-7/lynx_help/Lynx_users_guide.html
       7. http://lynx.isc.org/mirrors.html
       8. http://lists.nongnu.org/mailman/listinfo/lynx-dev/
       9. http://lynx.isc.org/signatures.html
      10. http://validator.w3.org/check?uri=http%3A%2F%2Flynx.isc.org%2Findex.html
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a shell script, thus: export PYTHONPATH=/usr/local/lib/python cd /home/skip/workspace/UAM for file in *.txt
I have a bash backup script run as root (cron) that delegates certain tasks
I have a shell script. A cron job runs it once a day. At
I have a cron job that call a shell script. */2 * * *
My ruby is in /usr/local/bin. whenever can't find it, and setting PATH at the
I have a cron shell script which calls a stored procedure to do some
I have a shell script which is called by a cron job. I don't
I have a cron entry that runs a script at a certain time each
I have a cron job to run a Ruby script, which runs fine on
I have a CRON job php script that I just set up not too

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.