Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

cron job - bash script that writes to other files

Discussion in 'General Discussion' started by liber77, Dec 22, 2011.

  1. liber77

    liber77 Registered

    Joined:
    Dec 22, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    51
    cPanel Access Level:
    Website Owner
    I have made a bash script that writes to other files like this, and I am going to run it as a cron job.

    Code:
    echo string >> file
    
    I have problems running it. Some people say that cron doesn't write to stdout. Is it possible to write to other files like this when the script is run as a cron job?
     
  2. NixTree

    NixTree Well-Known Member

    Joined:
    Aug 19, 2010
    Messages:
    405
    Likes Received:
    3
    Trophy Points:
    143
    Location:
    Gods Own Country
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    A bash script can write to files according to the commands, which set as a cron job. I have seen countless such scripts, for collecting load, memory usage, cpu usage, apche request pool, etc to files.

    Try to run that script manually and make sure that the cron owner have the necessary permission to write contents to the file.

    Thank you,
    Nibin.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice