6.4 Internationalization I18N
Create a local directory structure to hold *.mo (“machine object”) files created from *.po (“portable object”) by gettext machinery. One directory is needed for each language.
mkdir -p ${HOME}/share/locale/es/LC_MESSAGES
System-wide translation database is under /usr/share/locale. The installation of gettext() is its own documentation. Examine /usr/share/gettext/intl to see how its done.
Emacs po-mode.el should be loaded whenever *.po files are loaded.
34 7 FILES
7 Files
7.1 Date conventions
This section describes conventions for naming files from geophysical models. We adopt the usual convention that DD is a two digit sequence to indicate the day of month DD ∈ [01, 02, . . . , 31], MM is a two digit sequence to indicate the month of year MM ∈ [01, 02, . . . , 12], and YYYY is the four digit Common Era year. It is often useful to select files based on their date convention. In such cases it is useful to have regular expressions (cf. §6.2) for each date convention: Date components like MM and YYYY are not just keyboard inputs, they are also variables, since useful information may be derived from them. For example, the number of years N in a file containing data from years YYYY and ZZZZ is N = ZZZZ − YYYY + 1.
Valid replacements for DD are [0123][0-9]. Valid replacements for MM are [01][0-9].
Valid replacements for YYYY are [0-9][0-9][0-9][0-9].
Climatological values are abrreviated clm, which is best interpreted as “all of the available data present when the command was run”. Syntactically, clm works equivalently to YYYY. However, clm is only three characters, while YYYY is four characters. This distinction helps reduce errors when commands use globbing to do the right thing, e.g.,
ncra caseid_????01.nc caseid_clm01.nc # OK globbing
ncra caseid_[0-9][0-9][0-9][0-9]01.nc caseid_clm01.nc # Better ncra caseid_[0-9]{4}01.nc caseid_clm01.nc # Preferred
1. ${caseid}_YYYY Annual mean 2. ${caseid}_YYYYMM Monthly mean 3. ${caseid}_YYYYMMDD Daily mean 4. ${caseid}_YYYYMMDDHH Hourly mean 5. ${caseid}_YYYYMMDDHHMM Minute mean 6. ${caseid}_YYYYMMDDHHMMSS Second mean 7. ${caseid}_clm Climatological mean
8. ${caseid}_clmMM Climatological monthly mean
9. ${caseid}_YYYYZZZZ_MM Ensemble mean of month MM from years YYYY through ZZZZ(one record)
10. ${caseid}_YYYYZZZZ_0112 Ensemble mean of seasonal cycle sampled from years YYYY through ZZZZ (twelve records)
11. ${caseid}_YYYY_ZZZZ_MM Timeseries of month MM from years YYYY through ZZZZ (ZZZZ − YYYY + 1 records)
12. ${caseid}_YYYY_ZZZZ_MMNN Timeseries of month MM through month NN means from years YYYY through ZZZZ (ZZZZ − YYYY + 1 records)
7.1 Date conventions 35 13. ${caseid}_YYYY_ZZZZ_0305 Timeseries of Springtime means from years YYYY through
ZZZZ(ZZZZ − YYYY + 1 records)
14. ${caseid}_clm_0112 Twelve month seasonal cycle
15. ${caseid}_YYYY_0112 Annual mean seasonal cycle (12 records). Note this is an ex-ception to the general rule. It is unambiguous, however, because the mean of all twelve months is simple representable by the ${caseid}_YYYY convention
16. ${caseid}_YYYY_MMNN Mean of months MM through NN (1 record) 17. ${caseid}_YYYY_0305 Springtime mean (1 record)
18. ${caseid}_YYYY_ZZZZ Annual mean timeseries (multiple records)
19. ${caseid}_YYYYMM_ZZZZNN Monthly mean timeseries from YYYYMM to ZZZZNN, inclusive (multiple records)
20. ${caseid}_YYYYMMDD_ZZZZNNEE Daily mean timeseries from YYYYMMDD to ZZZZNNEE, inclusive (multiple records)
21. ${caseid}_YYYY_ZZZZ_t Mean of annual mean timeseries from YYYY to ZZZZ, inclu-sive (single record)
22. ${caseid}_YYYYMM_ZZZZNN_t Mean of monthly mean timeseries from YYYYMM to ZZZZNN, inclusive (single record)
23. ${caseid}_YYYYMMDD_ZZZZNNEE_t Mean of daily mean timeseries from YYYYMMDD to ZZZZNNEE, inclusive (single record)
36 8 SYSTEM ADMINISTRATION
8 System Administration
8.1 Backups
Simple but effective system backups are made each night. The Cron system performs specified actions at regular intervals. The cron program checks for actions to perform once per minute.
Currently, all backups are handled by the crontab file of the root user. Use the crontab program to alter any user’s crontab.
crontab -e
sudo crontab -u root -e
The crontab program stores each user’s crontab in /var/spool/cron. For the root user, this is /var/spool/cron/root and /var/spool/cron/crontabs/root for RedHat and Debian GNU/Linux, respectively. Currently this system backup crontab file is
15 2 * * * /usr/local/bin/bck_home.sh zender 45 2 * * * /usr/local/bin/bck_home.sh bian 15 3 * * * /usr/local/bin/bck_home.sh alfgr 45 3 * * * /usr/local/bin/bck_home.sh mflanner 15 4 * * * /usr/local/bin/bck_home.sh kwon 45 4 * * * /usr/local/bin/bck_home.sh strombrg 15 5 * * * /usr/local/bin/bck_home.sh lopez 45 5 * * * /usr/local/bin/bck_home.sh jtalaman 15 6 * * * /usr/local/bin/bck_home.sh okin 45 6 * * * /usr/local/bin/bck_home.sh pajarola 30 5 * * * /usr/local/bin/bck_data.sh
35 5 * * * /usr/local/bin/bck_etc.sh 40 5 * * * /usr/local/bin/bck_var.sh
37 3 * * * /usr/bin/rdate -s time.nist.gov 38 3 * * * /sbin/hwclock --systohc
The first column is the minute of each hour for an action. The second column is the hour of each day for an action. The third, fourth, and fifth columns are the day of month, month of year, and year for the corresponding actions. Asterisks denote all values for the corresponding field. Always backup data to at least two physically separate locations!
My personal, user-specific crontab file is
30 2 * * * /home/zender/sh/bck_zender.sh dly
Note that the backup commands themselves are only valid when specified with fully qualified paths. This security feature of Cron helps prevent malicious files from being inadvertently exe-cuted.
Backup binaries from /usr/local/bin (e.g., ddd, netscape). The script bck.pl is devoted to this, and works for ZIP disks and LS120 drives too. “Dot” files (e.g., .cshrc, .mailrc, .netscape directory) should be relatively safe as they are frequently archived by CVS. The most important files to backup thus become files in the mail directories.