forked from n-i-x/pc-autobackup
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add diagnostic script to help troubleshoot issues
- Loading branch information
Showing
2 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
# Make sure only root can run our script | ||
if [[ $EUID -ne 0 ]]; then | ||
echo "This script must be run as root" 1>&2 | ||
exit 1 | ||
fi | ||
|
||
echo "Cleaning up after any previous runs..." | ||
rm diagnose_me.zip diagnose_me.tcpdump diagnose_me.log nohup.out | ||
|
||
echo "Gathering basic system information..." | ||
uname -a > diagnose_me.log | ||
echo >> diagnose_me.log | ||
|
||
echo "Gathering basic network information..." | ||
ifconfig -a >> diagnose_me.log | ||
echo >> diagnose_me.log | ||
netstat -rnW >> diagnose_me.log | ||
echo >> diagnose_me.log | ||
netstat -vnlW >> diagnose_me.log | ||
echo >> diagnose_me.log | ||
|
||
echo "Gathering process information..." | ||
ps auxwww >> diagnose_me.log | ||
echo >> diagnose_me.log | ||
echo >> diagnose_me.log | ||
|
||
echo "Starting network capture..." | ||
nohup tcpdump -e -s 1514 -w diagnose_me.tcpdump & | ||
|
||
echo "Starting pc_autobackup in debug mode..." | ||
nohup ./pc_autobackup.py --debug --log_file=diagnose_me.log & | ||
|
||
sleep 3 | ||
echo | ||
echo | ||
echo | ||
echo "Please start AutoBackup on your camera..." | ||
echo | ||
read -p "Press [Enter] key once AutoBackup fails/finishes..." | ||
|
||
echo "Shutting down pc_autobackup..." | ||
pkill pc_autobackup.py | ||
|
||
echo "Shutting down network capture..." | ||
pkill tcpdump | ||
|
||
echo "Archiving diagnostic files..." | ||
zip -9 diagnose_me.zip diagnose_me.tcpdump diagnose_me.log nohup.out | ||
|
||
echo "Deleting diagnostic files..." | ||
rm diagnose_me.tcpdump diagnose_me.log nohup.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters