Trouble exciting script in both ssh and Diagnostics>Command Prompt.
-
Hi,
Trouble exciting script in both ssh and Diagnostics>Command Prompt. I have a script I will share below that will start a Pcap for 15 Min and save the file to /capsave/wan. I am not able to excite the filename.sh file with ./filename.sh. I have performed a chmod +x filename/sh on the in it’s location capasver/scripts. After I am able to test this script I am going to add it to cron and have it randomly run several times day. Ways I have attempted to execute the script from ./filename.sh from directory the script is located in ./filename.sh. I have tried ./capseve/scripts/filename.sh from with in the directory of the file location and from the root ./ and from ./root So my syntax / location. is not correct. Help with this would make my day better. Screenshots below.
Script: one15minpcap.sh
#!/bin/sh
Log script start time
echo "Starting WAN capture at $(date)"
Capture WAN Interface for 5 minutes
/usr/sbin/tcpdump -i wan -w /capsave/wan/wan_capture_$(date +"%Y-%m-%d_%H-%M-%S").pcap -s 0 -W 1 -Z root -e &
Sleep for 5 minutes
sleep 300
Log script end time
echo "WAN capture completed at $(date)"
-
@VMlabman A script or command run in the web GUI has to exit on its own. Otherwise it will wait in the background forever.
Your post says "excite" a couple of times, did you mean "execute" or "exit"?
In your image, capture_script.sh is marked executable but not readable.
-
I am looking at the file permissions: -rwxr-xr-x 1 root wheel 320 May 3 11:06 one15minpcapwan.sh depicted in a screenshot below. I am an newbie can you tell me what command I would run to make this readable correctly and executing as a script for later use in crontab.
To answer your question regarding exaction one x
@SteveITS said in Trouble executing script in both ssh and Diagnostics>Command Prompt.:
Your post says "excite" a couple of times, did you mean "execute" or "exit"?
I am referring to execute. -
@VMlabman said in Trouble exciting script in both ssh and Diagnostics>Command Prompt.:
tcpdump -i wan
For one that is not a valid interface.. You would need to use like igb0 or em1 or eth0 or ix0, etc.. whatever your actual wan interface is.
-
@VMlabman do you get an error when you run the script?
-
@SteveITS looks like it to me, from his posting
-
@johnpoz said in Trouble exciting script in both ssh and Diagnostics>Command Prompt.:
from his posting
That would mean the script is running though. And then the error would presumably be "wan" as you pointed out.
-
@SteveITS true the script did execute ;)