## 6.7 Wajig Automatic Daily Updates

20210401 Wajig can be run from crontab to automatically update your system daily. This is best practise in today’s environment where it is certain that the software we are running has bugs and flaws that can be quickly taken advantage of if not patched. The simplest approach is to add an entry to the system administrator (root) crontab. For the first time you may find that you are asked to configure an editor. If you don’t have a preference, go with nano.

\$ sudo crontab -e

no crontab for root - using an empty one

Select an editor.  To change later, run 'select-editor'.
1. /bin/nano        <---- easiest
2. /usr/bin/vim.basic
3. /usr/bin/vim.tiny
4. /usr/bin/emacs
5. /bin/ed

Choose 1-5 [1]: 

Decide on the frequency of the upgrades. This can be anything really, but a good choice is to upgrade at 3am every day. The following crontab entry does this:

# m h  dom mon dow   command
0 3 * * * (wajig update; wajig distupgrade --yes) > /home/kayon/cronlog_date +\%Y\%m\%d.log 2>&1

Notice the helpful comment lines in the crontab file as a guide to the format of an entry: m (minute); h (hour); dom (day of month); dow (day of week); and then followed by the command to run. A * for any of the date/time fields represents any.

The command here uses parentheses to group two commands and have them executed in a sub-shell. This then allows the output from both to be redirected to a file in a user’s home directory. The file has the current date as a suffix. Any errors written to stderr (file descriptor 2) are appended to stdout (file descriptor 1 the default for the first redirect >).

Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.19057472050189972, "perplexity": 5326.853694891587}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-05/segments/1642320299894.32/warc/CC-MAIN-20220129002459-20220129032459-00283.warc.gz"}