[rear-devel] [rear/rear] 7564c5: explain the FULLBACKUPDAY variable in the default....

Johannes Meixner jsmeix at suse.de
Wed Jun 3 14:03:01 CEST 2015


Hello Gratien,

On Jun 3 04:36 Gratien D'haese wrote (excerpt):
> Commit: 7564c51b34e4fe3575495428cba30fe80df43728
> https://github.com/rear/rear/commit/7564c51b34e4fe3575495428cba30fe80df43728

This commit contains (excerpt)
--------------------------------------------------------
+# ... FULLBACKUPDAY=Mon ... use the "day +%a" syntax
--------------------------------------------------------


1)

I think "day ..." is a typo and should be "date +%a"
(at least on SUSE systems there is no 'day' command).


2)

I wonder if a value of the form "date +%a" is fail-safe
to use because "man date" reads:
---------------------------------------------------------
   %a     locale's abbreviated weekday name (e.g., Sun)
---------------------------------------------------------

This means the value of the form "date +%a" depends
on the (arbitrary) locale settings of the user who
runs rear, for example:
---------------------------------------------------------
# export LC_ALL=POSIX ; export LANG=POSIX ; date +%a
Wed

# export LC_ALL=de_DE ; export LANG=de_DE ; date +%a
Mi

# export LC_ALL=fr_BE ; export LANG=fr_BE ; date +%a
mer

# export LC_ALL=tr_TR ; export LANG=tr_TR ; date +%a
Çrþ
---------------------------------------------------------

To be fail-safe against arbitrary locale settings
I suggest to use a non-locale dependant day format
for example "date +%u" as in "man date"
---------------------------------------------------------
   %u     day of week (1..7); 1 is Monday
---------------------------------------------------------
which seems to work o.k. at least for me:
---------------------------------------------------------
# export LC_ALL=POSIX ; export LANG=POSIX ; date +%u
3

# export LC_ALL=de_DE ; export LANG=de_DE ; date +%u
3

# export LC_ALL=fr_BE ; export LANG=fr_BE ; date +%u
3

# export LC_ALL=tr_TR ; export LANG=tr_TR ; date +%u
3
---------------------------------------------------------


Kind Regards
Johannes Meixner
-- 
SUSE LINUX GmbH - GF: Felix Imendoerffer, Jane Smithard,
Dilip Upmanyu, Graham Norton - HRB 21284 (AG Nuernberg)


More information about the rear-devel mailing list