1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Create a cron job to execute a php script using php

Discussion in 'Plesk for Linux - 8.x and Older' started by dfutura, Jan 18, 2008.

  1. dfutura

    dfutura Basic Pleskian

    23
    57%
    Joined:
    May 10, 2004
    Messages:
    30
    Likes Received:
    0
    I need to create a cron job or something similar with a php script. I try to create a file usingh php in etc/crontab like this:

    $archivo = '/var/cron.d/pruebaCronMandaMail';
    $fp = fopen($archivo, "a");
    $string = "/usr/bin/php -q /var/www/vhosts/domain.com/httpdocs/createCronScript.php";
    $write = fputs($fp, $string);
    print_r($write);
    fclose($fp);

    But with apache user i cant create this file.

    How can i do?
     
Loading...