The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    1
    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:
    387
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Gods Own Country
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page