Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logs to usb #45

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Logs to usb #45

wants to merge 2 commits into from

Conversation

toys4me
Copy link
Contributor

@toys4me toys4me commented Feb 3, 2013

Copy logs and diagnostic info to USB storage automatically on device insert

This is a simple mod to usbmount rules to gather debug information for cases where you can't SSH into the box.

When device can't connect to a network it can be difficult to troubleshoot issue as you can't retrieve logs from the system. This simple patch is designed to leverage a usb flash drive and the usbmount process to run diagnostics under certain conditions when a usb flash drive is plugged it and output the results to the flash drive.

After this patch, take a usb flash drive and create a directory on it called getlogs in the root directory:
mkdr /getlogs
Then plug the usb drive into system and if the getlogs directory exists the diag.sh script will run and put its contents in /getlogs/diag.txt and the script will also copy the xbmc log files to the getlogs directory as well.

The modification also looks for a shell script in /getlogs/runme.sh
Which allows additional commands to be run after USB device is inserted. The mountpoint directory is passed as an argument to the runme.sh scripts as first argument.
Can be used for things like updating firmware or gathering additional diagnostic information.

This is a simple mod to usbmount to gather debug information for cases where you can't
SSH into the box.

When device can't connect to a network it can be difficult to troubleshoot issue as you can't retrieve logs from the system.   This simple patch is designed to leverage a usb flash drive and the usbmount process to run diagnostics under certain conditions when a usb flash drive is plugged it and output the results to the flash drive.

After this patch, take a usb flash drive and create a directory on it called getlogs in the root directory:
  mkdr /getlogs
Then plug the usb drive into system and if the getlogs directory exists the diag.sh script will run and put its contents in /getlogs/diag.txt and the script will also copy the xbmc log files to the getlogs directory as well.

The modification also looks for a shell script in /getlogs/runme.sh
Which allows additional commands to be run after USB device is inserted.   The mountpoint directory is passed as an argument to the runme.sh scripts as first argument.
keeps /dev/sda1 from matching /dev/sda10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant