Skip to content

Commit

Permalink
typo fix + fix rsync command
Browse files Browse the repository at this point in the history
fix for #92 , bad fuzzy parameter
  • Loading branch information
David MICHEL committed Sep 20, 2019
1 parent bd38f34 commit 0dc5827
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Like ramlog for systemd (on debian 8 jessie for example).

Usefull for **RaspberryPi** for not writing on the SD card all the time. You need it because your SD card doesn't want to suffer anymore!

Explanations: The script creates a `/var/log` mount point in RAM. So any writing of the log to the `/var/log` folder will not actually be written to disk (in this case to the sd card for a raspberry card) but directly to RAM. By default, every hour, the CRON will launch a synchronization of the RAM to the folder located on the physical disk. The script will also make this copy of RAM to disk in case of machine shutdown (but cannot do it in case of power failure). This way you avoid excessive writing on the SD card.
Explanations: The script creates a `/var/log` mount point in RAM. So any writing of the log to the `/var/log` folder will not actually be written to disk (in this case to the sd card for a raspberry card) but directly to RAM. By default, every days, the CRON will launch a synchronization of the RAM to the folder located on the physical disk. The script will also make this copy of RAM to disk in case of machine shutdown (but cannot do it in case of power failure). This way you avoid excessive writing on the SD card.

The script [log2ram](https://github.com/azlux/log2ram) can work on every linux system. So you can use it with your own daemon manager if you don't have systemd.

Expand Down Expand Up @@ -41,7 +41,7 @@ In the file `/etc/log2ram.conf`, there are three variables:
- `ZL2R`: Enable zram compatibility (`false` by default). Check the comment on the config file. See https://github.com/StuartIanNaylor/zram-swap-config to configure a zram space on your raspberry before enable this option.

#### refresh time:
By default Log2Ram writes to the HardDisk every day. If you think this is too much, you can move `/etc/cron.daily/log2ram` in antoiher cron folder, or remove it if you prefer writing logs only at stop/reboot.
By default Log2Ram writes to the HardDisk every day. If you think this is too much, you can move `/etc/cron.daily/log2ram` in an other cron folder, or remove it if you prefer writing logs only at stop/reboot.

### It is working?
You can now check the mount folder in ram with (You will see lines with log2ram if working)
Expand Down
4 changes: 2 additions & 2 deletions log2ram
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ syncToDisk () {
isSafe

if [ "$USE_RSYNC" = true ]; then
rsync -aXWv --fuzzy --no-whole-file --append --delete-after --links $RAM_LOG/ $HDD_LOG/ 2>&1 | $LOG_OUTPUT
rsync -aXv --inplace --no-whole-file --delete-after $RAM_LOG/ $HDD_LOG/ 2>&1 | $LOG_OUTPUT
else
cp -rfup $RAM_LOG/ -T $HDD_LOG/ 2>&1 | $LOG_OUTPUT
fi
Expand All @@ -38,7 +38,7 @@ syncFromDisk () {
fi

if [ "$USE_RSYNC" = true ]; then
rsync -aXWv --fuzzy --no-whole-file --append --delete-after --links $HDD_LOG/ $RAM_LOG/ 2>&1 | $LOG_OUTPUT
rsync -aXv --inplace --no-whole-file --delete-after $HDD_LOG/ $RAM_LOG/ 2>&1 | $LOG_OUTPUT
else
cp -rfup $HDD_LOG/ -T $RAM_LOG/ 2>&1 | $LOG_OUTPUT
fi
Expand Down

0 comments on commit 0dc5827

Please sign in to comment.