1

The following successfully prevents my cacti backup script from running while data is being updated, but I would prefer it if the conditional "ps -C php -f | grep poller" wasn't continuously printing to the console. How can I accomplish this?

#wait till cron job done running:
while  ps -C php -f  | grep poller
do
sleep 1
done
echo "Cron job done. Starting backup"
Dustin Soodak
  • 553
  • 5
  • 15

1 Answers1

0

use the -q option to grep so it doesn't print the output

while ps -C php -f | grep -q poller
Barmar
  • 741,623
  • 53
  • 500
  • 612