ramlog: remove obsolete nocache; fixes #6890

This commit is contained in:
Alex Shumsky
2024-10-13 22:27:00 +03:00
committed by Igor
parent 749aea39e4
commit 73d521da42
5 changed files with 4 additions and 9 deletions

View File

@@ -1,3 +1,2 @@
gpiod gpiod
nocache
firmware-sof-signed firmware-sof-signed

View File

@@ -1,3 +1,2 @@
gpiod gpiod
mtd-utils mtd-utils
nocache

View File

@@ -1,2 +1 @@
gpiod gpiod
nocache

View File

@@ -1,3 +1,2 @@
gpiod gpiod
mtd-utils mtd-utils
nocache

View File

@@ -23,7 +23,6 @@ LOG_OUTPUT="tee -a $LOG2RAM_LOG"
isSafe () { isSafe () {
[ -d $HDD_LOG ] || (echo "ERROR: $HDD_LOG doesn't exist! Can't sync." >&2 ; exit 1) [ -d $HDD_LOG ] || (echo "ERROR: $HDD_LOG doesn't exist! Can't sync." >&2 ; exit 1)
NoCache=$(command -v nocache 2>/dev/null)
} }
RecreateLogs (){ RecreateLogs (){
@@ -48,7 +47,7 @@ syncToDisk () {
echo -e "\n\n$(date): Syncing logs to storage\n" | $LOG_OUTPUT echo -e "\n\n$(date): Syncing logs to storage\n" | $LOG_OUTPUT
if [ "$USE_RSYNC" = true ]; then if [ "$USE_RSYNC" = true ]; then
${NoCache} rsync -aXWv \ rsync -aXWv \
--exclude "lost+found" --exclude armbian-ramlog.log \ --exclude "lost+found" --exclude armbian-ramlog.log \
--exclude 'journal*' --one-file-system \ --exclude 'journal*' --one-file-system \
--links \ --links \
@@ -56,7 +55,7 @@ syncToDisk () {
$RAM_LOG/ $HDD_LOG/ 2>&1 | $LOG_OUTPUT $RAM_LOG/ $HDD_LOG/ 2>&1 | $LOG_OUTPUT
else else
rm -f $RAM_LOG/journal # linked journal cannot copied onto itself, it will be re-created below rm -f $RAM_LOG/journal # linked journal cannot copied onto itself, it will be re-created below
${NoCache} cp -rfup $RAM_LOG -T $HDD_LOG 2>&1 | $LOG_OUTPUT cp -rfup $RAM_LOG -T $HDD_LOG 2>&1 | $LOG_OUTPUT
fi fi
if [ ! -L $RAM_LOG/journal ] && [ -d $RAM_LOG/journal ]; then # move persistent journal to disk if [ ! -L $RAM_LOG/journal ] && [ -d $RAM_LOG/journal ]; then # move persistent journal to disk
systemctl stop systemd-journald # journal folder can be in use systemctl stop systemd-journald # journal folder can be in use
@@ -83,7 +82,7 @@ syncFromDisk () {
echo -e "\n\n$(date): Loading logs from storage\n" | $LOG_OUTPUT echo -e "\n\n$(date): Loading logs from storage\n" | $LOG_OUTPUT
if [ "$USE_RSYNC" = true ]; then if [ "$USE_RSYNC" = true ]; then
${NoCache} rsync -aXWv --delete \ rsync -aXWv --delete \
--exclude "lost+found" --exclude armbian-ramlog.log \ --exclude "lost+found" --exclude armbian-ramlog.log \
--exclude '*.gz' --exclude '*.xz' --exclude='*.[0-9]' \ --exclude '*.gz' --exclude '*.xz' --exclude='*.[0-9]' \
--links \ --links \
@@ -91,7 +90,7 @@ syncFromDisk () {
${XTRA_RSYNC_FROM[@]+"${XTRA_RSYNC_FROM[@]}"} \ ${XTRA_RSYNC_FROM[@]+"${XTRA_RSYNC_FROM[@]}"} \
$HDD_LOG/ $RAM_LOG/ 2>&1 | $LOG_OUTPUT $HDD_LOG/ $RAM_LOG/ 2>&1 | $LOG_OUTPUT
else else
${NoCache} find $HDD_LOG/* -maxdepth 1 -type f -not \( -name '*.[0-9]' -or -name '*.xz*' -or -name '*.gz' -or -name 'journal*' \) | xargs cp -ut $RAM_LOG/ find $HDD_LOG/* -maxdepth 1 -type f -not \( -name '*.[0-9]' -or -name '*.xz*' -or -name '*.gz' -or -name 'journal*' \) | xargs cp -ut $RAM_LOG/
fi fi
if [ ! -L $RAM_LOG/journal ] && [ -d $HDD_LOG/journal ]; then # link persistent journal if applicable if [ ! -L $RAM_LOG/journal ] && [ -d $HDD_LOG/journal ]; then # link persistent journal if applicable