error in CronJobs [ /bin/sh: -c: line 0: syntax error near unexpected token `|' ]

Banisaeed

Verified User
Joined
Sep 23, 2015
Messages
24
Location
banisaeed.com
hello

how to fix this error in cronjobs:

cronjob:
| php -q /home/admin/domains/domain.com/crons/pipe.php

Error in received email:
Code:
/bin/sh: -c: line 0: syntax error near unexpected token `|'
/bin/sh: -c: line 0: `| php -q /home/admin/domains/domain.com/crons/pipe.php'

thanks.
 
Last edited:

Zhenyapan

Verified User
Joined
Feb 23, 2018
Messages
121
Location
UA
check first line of file and check your cron command, there are two separate signs -`-and -'- between dashes
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,789
Location
LT, EU
I guess it’s an email pipe, you should add it with | to email forwarders, not cronjobs.
 

Banisaeed

Verified User
Joined
Sep 23, 2015
Messages
24
Location
banisaeed.com
thanks smtalk
how to setup email piping via forwarders in directadmin ?

whmcs message:
Important Notes
Note: The pipe.php file requires 755 permissions to function properly.
If using DirectAdmin, you must enter the command enclosed in quotes "" for it to be accepted.
 
Top