Procházet zdrojové kódy

better rsync use

typo #82, improvement #81
tags/v1.3
Azlux před 5 roky
rodič
revize
bd38f34a25
5 změnil soubory, kde provedl 6 přidání a 6 odebrání
  1. +1
    -1
      README.md
  2. +2
    -2
      install.sh
  3. +2
    -2
      log2ram
  4. +0
    -0
      log2ram.cron
  5. +1
    -1
      uninstall.sh

+ 1
- 1
README.md Zobrazit soubor

@@ -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. - `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: #### refresh time:
By default Log2Ram writes to the HardDisk every hour. If you think this is too much, you can make the write every day by moving the cron file to daily: `sudo mv /etc/cron.hourly/log2ram.hourly /etc/cron.daily/log2ram.daily`.
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.


### It is working? ### It is working?
You can now check the mount folder in ram with (You will see lines with log2ram if working) You can now check the mount folder in ram with (You will see lines with log2ram if working)


+ 2
- 2
install.sh Zobrazit soubor

@@ -12,11 +12,11 @@ install -m 644 uninstall.sh /usr/local/bin/uninstall-log2ram.sh
systemctl enable log2ram systemctl enable log2ram


# cron # cron
install -m 755 log2ram.hourly /etc/cron.hourly/log2ram
install -m 755 log2ram.cron /etc/cron.daily/log2ram
install -m 644 log2ram.logrotate /etc/logrotate.d/log2ram install -m 644 log2ram.logrotate /etc/logrotate.d/log2ram


# Remove a previous log2ram version # Remove a previous log2ram version
rm -rf /var/log.hdd
rm -rf /var/log.hdd


# Make sure we start clean # Make sure we start clean
rm -rf /var/hdd.log rm -rf /var/hdd.log


+ 2
- 2
log2ram Zobrazit soubor

@@ -18,7 +18,7 @@ syncToDisk () {
isSafe isSafe


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


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


log2ram.hourly → log2ram.cron Zobrazit soubor


+ 1
- 1
uninstall.sh Zobrazit soubor

@@ -7,7 +7,7 @@ then
rm /etc/systemd/system/log2ram.service rm /etc/systemd/system/log2ram.service
rm /usr/local/bin/log2ram rm /usr/local/bin/log2ram
rm /etc/log2ram.conf rm /etc/log2ram.conf
rm /etc/cron.hourly/log2ram
rm /etc/cron.daily/log2ram
rm /etc/logrotate.d/log2ram rm /etc/logrotate.d/log2ram


if [ -d /var/hdd.log ]; then if [ -d /var/hdd.log ]; then


Načítá se…
Zrušit
Uložit