1
0
mirror of https://github.com/azlux/log2ram.git synced 2023-10-10 13:37:24 +02:00

Update log2ram

Use date as fallback if printf -v fails. reason is, that printf -v is not defined in POSIX
This commit is contained in:
MegaV0lt 2019-09-27 08:40:38 +02:00 committed by GitHub
parent e993fa880e
commit 6294b73126
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,7 @@ RAM_LOG=/var/log
LOG_NAME="log2ram.log"
LOG2RAM_LOG="${RAM_LOG}/${LOG_NAME}"
LOG_OUTPUT="tee -a $LOG2RAM_LOG"
printf -v NOW '%(%F %H:%M:%S)T' -1 # Actual date and time
printf -v NOW '%(%F %H:%M:%S)T' -1 || NOW=$(date '+%F %H:%M:%S') # Actual date and time (date as fallback)
isSafe () {
[ -d $HDD_LOG/ ] || echo "ERROR: $HDD_LOG/ doesn't exist! Can't sync."