0

i have bash script which running in cron which is outputting to file. however in my script I am running another command which is meant to output to file but is not outputting to file.

bash

/opt/SP/php7/bin/php /var/httpd/domain/domain.com/scripts/cli-worker-manager.php processQueueAggregateFlows >> /var/httpd/domain/domain.com/scripts/logs/cli-worker-processQueueAggregateFlows.log 2>&1 &

# ps aux | grep cli-worker- | grep php | grep processQueueAggregateFlows

wwwadm   18141  0.0  0.1 456160 29524 ?        S    Mar05   0:08 /opt/SP/php7/bin/php /var/httpd/domain/domain.com/scripts/cli-worker-manager.php processQueueAggregateFlows

you can see >> /var/httpd/domain/domain.com/scripts/logs/cli-worker-processQueueAggregateFlows.log 2>&1 is missing when viewing the ps

the cronjob that i run does show up in ps

# ps aux | grep cli-worker-  | grep "cli-worker-aggregateFlows.sh"
wwwadm    5620  0.0  0.0 117304  1752 ?        Ss   15:19   0:00 /bin/sh -c . ~wwwadm/.bash_profile; /var/httpd/domain/domain.com/scripts/cli-worker-aggregateFlows.sh -e test >> /var/httpd/domain/domain.com/scripts/logs/cli-worker-processQueueAggregateFlows.log 2>&1
  • i have updated with addition of another ps – shorif2000 Mar 6 '18 at 14:25
  • 1
    @Kusalananda except PHP breaks with setbuf(3) tradition and line-buffers stdout regardless of where the output is going – thrig Mar 6 '18 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.