hardvk0 Posted February 28, 2016 Share Posted February 28, 2016 Hi.In the new image of banana pi (Armbian_5.00_Bananapi_Debian_jessie_4.4.1) there is no ramlog. apt-get can not find it. It has been permanently removed? Link to comment Share on other sites More sharing options...
Igor Posted February 28, 2016 Share Posted February 28, 2016 Read the download page closely ... Ramlog works only in Wheezy or Jessie without Systemd. Link to comment Share on other sites More sharing options...
hardvk0 Posted February 28, 2016 Author Share Posted February 28, 2016 Oh, sorry. I did not understand that "w/o" = without. google translator.Since the adoption of systemd by debian, I've only had problems. Do one thing and do it well, ha!!! Damn systemd. Damn RedHat. Sorry Igor Link to comment Share on other sites More sharing options...
hardvk0 Posted May 10, 2016 Author Share Posted May 10, 2016 I found this googling: https://github.com/azlux/log2ramIt would be a solution? It will work with Armbian? Link to comment Share on other sites More sharing options...
Igor Posted May 10, 2016 Share Posted May 10, 2016 I found this googling: https://github.com/azlux/log2ram It would be a solution? It will work with Armbian? Armbian is more or less plain Debian - it should work but there is only one way to be 100% sure. Link to comment Share on other sites More sharing options...
Azlux Posted July 28, 2016 Share Posted July 28, 2016 I found this googling: https://github.com/azlux/log2ramIt would be a solution? It will work with Armbian? Yes it should. If not, do not hesitate to open an issue on github I use basic functions of debian jessie, I don't see any problem for log2ram for working on your system. 1 Link to comment Share on other sites More sharing options...
infinity Posted August 12, 2016 Share Posted August 12, 2016 Yes it should. If not, do not hesitate to open an issue on github I use basic functions of debian jessie, I don't see any problem for ram2log to work on your system. I like your tool. Could you tell a bit more about the way it works? There is a size of 40MB. Does that mean that logs are written to disk as soon as 40MB of logs are collected, or is this just the size of Ramdisk? Is it possible that Ram2Log writes the logs every day at a specific time out of this ramdisk? Link to comment Share on other sites More sharing options...
hardvk0 Posted August 19, 2016 Author Share Posted August 19, 2016 /etc/cron.daily/log2ram: #!/bin/sh test -x /usr/local/bin/log2ram || exit 0 /usr/local/bin/log2ram write 1 Link to comment Share on other sites More sharing options...
hardvk0 Posted August 19, 2016 Author Share Posted August 19, 2016 I modified the code to expand to 256 mb.I changed the cp command for rsync, I do not remember exactly why I did it but surely solved a problem I had. /usr/local/bin/log2ram: #!/bin/sh HDD_LOG=/var/log.hdd/ RAM_LOG=/var/log/ SIZE=256M case "$1" in start) [ -d $HDD_LOG ] || mkdir $HDD_LOG mount --bind $RAM_LOG $HDD_LOG mount --make-private $HDD_LOG mount -t tmpfs -o nosuid,noexec,nodev,mode=0755,size=$SIZE ramlog $RAM_LOG rsync -aXWv --delete --links $HDD_LOG $RAM_LOG # cp -rfup $HDD_LOG -T $RAM_LOG ;; stop) rsync -aXWv --delete --links $RAM_LOG $HDD_LOG # cp -rfup $RAM_LOG -T $HDD_LOG umount -l $RAM_LOG umount -l $HDD_LOG ;; write) rsync -aXWv --delete --links $RAM_LOG $HDD_LOG # cp -rfup $RAM_LOG -T $HDD_LOG ;; esac Link to comment Share on other sites More sharing options...
Azlux Posted August 29, 2016 Share Posted August 29, 2016 I like your tool. Could you tell a bit more about the way it works? There is a size of 40MB. Does that mean that logs are written to disk as soon as 40MB of logs are collected, or is this just the size of Ramdisk? Is it possible that Ram2Log writes the logs every day at a specific time out of this ramdisk? Hi, 1. The mount folder is a tmpfs, it a static size. So the SIZE variable define the maximal size you allocate into your RAM for the log folder. (Mine is around 25MB) 2. You can make a CRON to make a 'service log2ram restart'. Into my script, the restart function copy the content into the initial disk folder 1 Link to comment Share on other sites More sharing options...
Azlux Posted August 29, 2016 Share Posted August 29, 2016 I modified the code to expand to 256 mb. I changed the cp command for rsync, I do not remember exactly why I did it but surely solved a problem I had. Thank for your suggestions. You can modify the code depending of your needs. (On a raspberry, 256Mb is the half of my RAM) The option -u of the cp make a update -u, --update copy only when the SOURCE file is newer than the destination file or when the destination file is missing I think it's enough. But I will add yours improvements like a option. (Because I like minimalist program without dependencies) 1 Link to comment Share on other sites More sharing options...
infinity Posted September 2, 2016 Share Posted September 2, 2016 Hi, 1. The mount folder is a tmpfs, it a static size. So the SIZE variable define the maximal size you allocate into your RAM for the log folder. (Mine is around 25MB) 2. You can make a CRON to make a 'service log2ram restart'. Into my script, the restart function copy the content into the initial disk folder Thank you for your explanations As I am no coder, I'm still not sure how the script actually handles the logs. I understand that the logs are going to your created ramdisk (of the ramdisk-size specified with SIZE paramter), but when are they written do SD card finally? What triggers the writing to SD-Card? A full ramdisk, or a specific time? Or is your script meant to be always holding the logs in Ramdisk, thus losing all logs after a reboot. If this is the case, what happens if your "SIZE=25M" is full with logs? Does Ram2Log delete then the oldest logs according to a rotating principle? Link to comment Share on other sites More sharing options...
Azlux Posted September 2, 2016 Share Posted September 2, 2016 when are they written do SD card finally? -> It's a systemd script, so the log are written when the service stop What triggers the writing to SD-Card -> On a halt, a restart of the service or of the computer is your script meant to be always holding the logs in Ramdisk, thus losing all logs after a reboot -> No. You will lose your log only if your machine stop brutally (electricity failure for example) what happens if your "SIZE=25M" is full with logs -> it's like a partition for the log software (syslog) , the syslog will stop writting if it's full until your log rotate with logrotate.It's why you need to adapt this value. you can check the size with : df -h Does Log2Ram delete then the oldest logs according to a rotating principle? -> It's the job of logrotate, the job of log2ram is to mount a ram folder for your /var/log folder. 1 Link to comment Share on other sites More sharing options...
infinity Posted September 2, 2016 Share Posted September 2, 2016 aaaah thanks for all the answers so there is even a program called logotate it the system . This sounds all good, so it should be enough if I do a cronjob every morning (?): /etc/cron.daily/log2ram #!/bin/sh #save logs from ramdisk to harddrive: service log2ram restart Link to comment Share on other sites More sharing options...
Azlux Posted September 5, 2016 Share Posted September 5, 2016 infinity : Yes it's will work. It's do the same as hardvk0 script. /etc/cron.daily/log2ram: #!/bin/sh test -x /usr/local/bin/log2ram || exit 0 /usr/local/bin/log2ram write 1 Link to comment Share on other sites More sharing options...
infinity Posted September 5, 2016 Share Posted September 5, 2016 Ah okay, didn't know that :/. I really don't understand much about all this linux stuff, that is why I'm so dependent on this community . Thank you very much Link to comment Share on other sites More sharing options...
Recommended Posts