Logfile Download from Str
I am looking for a new maintainer for this project. If you are interested, please contact me!
This is a small Perl script intended to download logfiles
from Web accounts from Str
The problem is that the normal download interface is interactive, and that only about six weeks are kept on the server. So without scripting, you're likely to lose valuable log information (at least I was unable and unwilling to remember to download the logfiles once every six weeks).
This script logs in via the SSL-encrypted web-interface and downloads the files without needing a web-browser (proxies are configurable via the https_proxy environment variable).
Note: For SSL support, you might need additional Perl modules since some distros don't include crypto stuff: either use IO::Socket::SSL or Net::SSL (in Crypt::SSLeay).
If an SSL module is missing, https access will not work.
Usage is very easy:
$ get-logfiles -p mypassword www.mysite.de > logfile.gz
$ get-logfile -p bypassword -u www.mysite.de > logfiles.gz
Set the data in environment variables (in bash syntax):
$ export LOGFILE_SITE=www.mysite.de $ export LOGFILE_PWD=mypassword $ get-logfile > logfiles.gz
Same as before with reasonable name (note that in a crontab, you need to use \% instead of %):
$ get-logfile > "`date +%Y-%m-%d`".gz
Same as before, but only download the last 8..15 days:
$ get-logfile -start=32 > "`date +%Y-%m-%d`".gz
Same as before, but output diff wrt. files that already exist (new feature in v1.1):
$ get-logfile -start=32 -D *-*-*.gz > "`date +%Y-%m-%d`".gz
Missing Features / Future Work
- Add a switch to set output file name.
- Add a switch to automatically select output file name according to date.
- Make the diff handling better: select those files that might contain overlapping logfile parts automatically, and compare against those in order to create a new file only containing recent changes.
Version 1.2 (New Protocol)
- Feature: a new logfile download protocol was necessary, because the web interface changed (thanks to J. Puchalla for telling me -- it would probably have gone unnoticed otherwise).
Version 1.1 (Code Clean-Up, Docs, & Features)
- Feature: join mode: combine several log files into one (compare the entries and keep only one)
- Feature: diff mode: like join mode, but instead of combining, output changes in most recent file.
- Docu: added stronger note that an SSL module is needed
- Robustness: have a run-time check for an SSL module and produce an appropriate message.
- Robustness: repair the environment variable https_proxy in case it looks strange.
Version 1.0 (Initial)
- Initial release.