הרצת PHP מתוך cron

הרצת PHP מתוך cron

0 7 * * * cd /to/the/directory && php -f /to/the/directory/code.php >> /file.log 2>&1


יש לזכור לבצע cd  לספריה שבה יושב הקוד אחרת הוא יורץ מתוך ספריית הבית של ה - user

הוספת 
2>&1

בסוף השורה גורמת להודעות שגיאה שה - php מוציא להכנס ללוג stdout שאנחנו מיצרים בעזרת >>


No comments:

Post a Comment

Setting program_name in mysql session_connect_attrs allows you to see the name of the program connected

I am using mysql for quite some time now. I have noticed that looking at client connections using mysql workbench so an interesting column ...