There's an old saying, "anything worth doing, is worth automating"—or something like that. Downloading and reading Linux Journal always has been worth doing, and now you can automate it with our autolj script, which you can get here (updated to version 2.0, see the end of this article for a list of feature enhancements).
Follow the below few simple steps and you can download the entire magazine as a PDF, .epub or .mobi file with the greatest of ease each month. New to version 2.0 of this script, we've added the ability for you to pull down an individual Linux Journal article from the most recent issue within a terminal window (sometimes just reading one article at a time makes our wonderfully lengthy issues easier to get through!)
1) First download the script and save it somewhere; ~/bin is a good choice. You can name it whatever you like; it doesn't need to be called autolj.sh.
2) Open a terminal/shell and execute the following commands:
$ chmod +x ~/bin/autolj.sh $ ~/bin/autolj.sh --init Enter the email and zip/postal code associated with your Linux Journal subscription EMail: email@example.com # Enter your email address Zip : 88888 # Enter your zip/postal code Creating initial config file. Change your preferences in '/home/YOU/.config/autolj.cfg'. Sample crontab configuration is in '/home/YOU/.config/autolj.crontab'.
If you want to run the script from cron automatically each month, you can do this:
$ cp /home/YOU/.config/autolj.crontab mycrontab $ crontab -l >>mycrontab $ crontab
When you first run the script, use the
--init command-line option to initialize the configuration file for the script. It will prompt for the email and zip/postal code associated with your Linux Journal subscription.
It saves that information in a file named ~/.config/autolj.cfg (if you saved the script with a different name, the base name of the config file will match the name that you saved the script under).
You can edit the configuration file with any text editor that you have on hand, or you can rerun the script with the
--init option to re-create the config file (any existing changes that you've made will be lost).
The config file is a bash script that is sourced by the autolj script, so maintain valid bash syntax in the file. The config file contains a few other options that you may also want to change (the default value for each is shown):