mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
ramlog: remove obsolete nocache; fixes #6890
This commit is contained in:
@@ -23,7 +23,6 @@ LOG_OUTPUT="tee -a $LOG2RAM_LOG"
|
||||
|
||||
isSafe () {
|
||||
[ -d $HDD_LOG ] || (echo "ERROR: $HDD_LOG doesn't exist! Can't sync." >&2 ; exit 1)
|
||||
NoCache=$(command -v nocache 2>/dev/null)
|
||||
}
|
||||
|
||||
RecreateLogs (){
|
||||
@@ -48,7 +47,7 @@ syncToDisk () {
|
||||
echo -e "\n\n$(date): Syncing logs to storage\n" | $LOG_OUTPUT
|
||||
|
||||
if [ "$USE_RSYNC" = true ]; then
|
||||
${NoCache} rsync -aXWv \
|
||||
rsync -aXWv \
|
||||
--exclude "lost+found" --exclude armbian-ramlog.log \
|
||||
--exclude 'journal*' --one-file-system \
|
||||
--links \
|
||||
@@ -56,7 +55,7 @@ syncToDisk () {
|
||||
$RAM_LOG/ $HDD_LOG/ 2>&1 | $LOG_OUTPUT
|
||||
else
|
||||
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
|
||||
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
|
||||
@@ -83,7 +82,7 @@ syncFromDisk () {
|
||||
echo -e "\n\n$(date): Loading logs from storage\n" | $LOG_OUTPUT
|
||||
|
||||
if [ "$USE_RSYNC" = true ]; then
|
||||
${NoCache} rsync -aXWv --delete \
|
||||
rsync -aXWv --delete \
|
||||
--exclude "lost+found" --exclude armbian-ramlog.log \
|
||||
--exclude '*.gz' --exclude '*.xz' --exclude='*.[0-9]' \
|
||||
--links \
|
||||
@@ -91,7 +90,7 @@ syncFromDisk () {
|
||||
${XTRA_RSYNC_FROM[@]+"${XTRA_RSYNC_FROM[@]}"} \
|
||||
$HDD_LOG/ $RAM_LOG/ 2>&1 | $LOG_OUTPUT
|
||||
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
|
||||
|
||||
if [ ! -L $RAM_LOG/journal ] && [ -d $HDD_LOG/journal ]; then # link persistent journal if applicable
|
||||
|
||||
Reference in New Issue
Block a user