It only errs out if I run the script every 15 seconds (not show in post). The script was designed to run every 15 seconds and if a ping failed it runs tshark for a minute. We have a very evasive network issue, that comes and goes in a minute or less and needed a way to run a capture in the moment. I set the script to run every minute, instead and everything works fine, outside of the problem occurring 15 seconds later and ending before the next minute :) 


Thanks for checking 


From: "Joel Breazeale" <joel.breazeale at gmail.com> 
To: "tclug-list" <tclug-list at mn-linux.org> 
Sent: Thursday, October 24, 2019 7:54:26 PM 
Subject: Re: [tclug-list] bash script not working properly 

I'll bite. 
I notice you use capture.pcapng in Moveit.sh. How about fully qualifying the path with /home/raymond/capture.pcapng? 

Are you getting an error message from the failure? If so what is that error? 



On Wed, Oct 23, 2019 at 12:48 PM < admin at lctn.org > wrote: 
> 
> I have a simple bash script (ws.sh), with the following 2 commands: 
> 
> #!/bin/bash 
> 
> tshark -i enp1s0 -a duration:60 -w /home/raymond/capture.pcapng 
> 
> wait 
> 
> /home/raymond/movit.sh 
> 
> Movit.sh: 
> 
> 
> #!/bin/bash 
> mv capture.pcapng $(date +%F-%H:%M)1.pcapng && touch capture.pcapng 
> echo "All Done!" 
> 
> The first command always works properly but the second does not run via cron. However, running the script (ws,sh) via the command line executes properly. I have tried sleep and wait between commands but nothing works, so far. 
> 
> Ideas? 
> 
> 
> 
> Raymond Norton 
> LCTN 
> 952.955.7766 
> _______________________________________________ 
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota 
> tclug-list at mn-linux.org 
> http://mailman.mn-linux.org/mailman/listinfo/tclug-list 

_______________________________________________ 
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota 
tclug-list at mn-linux.org 
http://mailman.mn-linux.org/mailman/listinfo/tclug-list 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20191024/7b2c7aa2/attachment.html>