Find the answer to your Linux question:
Results 1 to 2 of 2
i have a very simple bash script that I schedule to run every hour. But the problem is, this script does run but the command inside doesn't work. If I ...
  1. #1
    Just Joined!
    Join Date
    Apr 2010
    Posts
    1

    problem running bash script from cron

    i have a very simple bash script that I schedule to run every hour.

    But the problem is, this script does run but the command inside doesn't work.

    If I run it manually, it works. I am puzzled!!!

    Here is the script:
    Code:
    #!/bin/bash
    /usr/bin/pon vpn1
    crontab run under root user.
    30 */1 * * * /home/script.sh

    Problem is not the cron but the script doesn't work when run under cron.

    If I run it manually using ./script.sh, then it will work.

    Any ideas?

    *the pon command is to connect to a remote vpn server

  2. #2
    Linux Enthusiast scathefire's Avatar
    Join Date
    Jan 2010
    Location
    Western Kentucky
    Posts
    616
    what happens when you put it in /etc/crontab instead of the personal crontab I've never liked using personal crontabs, they always seem to have problems.
    Code:
    30 */1 * * * root /home/script.sh
    linux user # 503963

Posting Permissions

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