Re: bash script not working properly

Munir Nassar <[email protected]>
Newsgroups gmane.user-groups.linux.tclug
Message-ID <CAKpMjPjuLNmU21t=20z+Phagr8NbXzE4DoNsGAOsxn8JpJtP=g@mail.gmail.com>
I suspect that the wait has something to do with it, is the idea to
wait for the tshark to complete?

I would use a sleep 5 before calling movit.sh. speaking of which, why
now put the mv commands at the end of the ts.sh? why bother calling a
separate script at all?

Finally, you should be using the -b option to tshark to put it in
multiple output mode to collect pcaps over time something like -b
duration:60

On Wed, Oct 23, 2019 at 12:48 PM <[email protected]> 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
> [email protected]
> http://mailman.mn-linux.org/mailman/listinfo/tclug-list
_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
[email protected]
http://mailman.mn-linux.org/mailman/listinfo/tclug-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.