navyasri Posted February 10, 2021 Posted February 10, 2021 I wrote a linux shell script course that ping once an IP address and echoes the results of the ping with the addition of the date command. If I run the script by my self it works just fine and I can also save the script's results to a file with the >> operator like this: script.sh >> log_file. The problem starts when I scheduling it in the crontab editor then only the date command result is saved to a file without the ping result. my script is: #!/bin/zsh echo $(date +"%T %D") ping -c1 google.com | while read replay do echo $replay done and the corn job is: * * * * * ~/new_scrip.sh >> /tmp/plog Share this post Link to post Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now