RamLog #2 not creating /root/logfile_storage Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
FESyv
Posts: 12
Joined: Sat May 04, 2019 11:13 pm

RamLog #2 not creating /root/logfile_storage

Post by FESyv »

dietpi ver: 6.31.2

i choose ramlog#2 for logging via dietpi-software. it installed and rebooted. and status of dietpi-ramlog.service is running.

but there is no /root/logfile_storage dir created. it did create these /var/tmp/dietpi/logs and /var/tmp/dietpi/logs/dietpi-ramlog_store.

isn't ramlog #2 supposed to create a dir "logfile_storage" in /root ?

if so any ideas how to get that working?
User avatar
Joulinar
Posts: 2072
Joined: Sat Nov 16, 2019 12:49 am

Re: RamLog #2 not creating /root/logfile_storage

Post by Joulinar »

Hi,

many thanks for your report. That's all as expected. The directory /root/logfile_storage will be created on the first hourly clean up. Usually this happen at the 17th minuteof a hour.

I did a test for you ;)

01:16 - no folder /root/logfile_storage

Code: Select all

root@DietPi3:~# date
Thu Jul 16 01:16:25 CEST 2020
root@DietPi3:~# ls -la
total 40
drwx------  6 root root 4096 Jul 16 00:01 .
drwxr-xr-x 21 root root 4096 Jul  4 01:29 ..
-rw-------  1 root root 3088 Jul 16 00:39 .bash_history
-rw-r--r--  1 root root  570 Jul  4 01:27 .bashrc
drwxr-xr-x  3 root root 4096 Jul 13 00:26 .cache
drwx------  3 root root 4096 Jul 13 00:51 .config
drwxr-xr-x  3 root root 4096 Jul  4 01:29 .local
-rw-r--r--  1 root root  148 May 10 22:59 .profile
drwxr-xr-x  2 root root 4096 Jun  8 12:05 .ssh
-rw-r--r--  1 root root  349 Jul 14 14:56 .wget-hsts
hourly cron job completed

Code: Select all

Jul 16 01:17:01 DietPi3 CRON[993]: (root) CMD (cd / && run-parts --report /etc/cron.hourly)
01:17 - folder /root/logfile_storage created

Code: Select all

root@DietPi3:~# ls -la
total 44
drwx------  7 root root 4096 Jul 16 01:17 .
drwxr-xr-x 21 root root 4096 Jul  4 01:29 ..
-rw-------  1 root root 3088 Jul 16 00:39 .bash_history
-rw-r--r--  1 root root  570 Jul  4 01:27 .bashrc
drwxr-xr-x  3 root root 4096 Jul 13 00:26 .cache
drwx------  3 root root 4096 Jul 13 00:51 .config
drwxr-xr-x  3 root root 4096 Jul  4 01:29 .local
-rw-r--r--  1 root root  148 May 10 22:59 .profile
drwxr-xr-x  2 root root 4096 Jun  8 12:05 .ssh
-rw-r--r--  1 root root  349 Jul 14 14:56 .wget-hsts
drwxr-xr-x  3 root root 4096 Jul 16 01:17 logfile_storage
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
FESyv
Posts: 12
Joined: Sat May 04, 2019 11:13 pm

Re: RamLog #2 not creating /root/logfile_storage

Post by FESyv »

thanks for your reply/help.

after a few hours the logfile_storage dir still wasn't being created.

i went ahead and manually ran "/boot/dietpi/func/dietpi-logclear 0" and of course it created the dir and copied the files there and cleared the files in /var/log.

i'll check later tonite and see if corn.hourly ran and called dietpi-logclear.
User avatar
Joulinar
Posts: 2072
Joined: Sat Nov 16, 2019 12:49 am

Re: RamLog #2 not creating /root/logfile_storage

Post by Joulinar »

Hi,

basically the log switch is triggered from following file /etc/cron.hourly/dietpi. Depending on the setting in config file /boot/dietpi/.installed, log switch will be initiated. LOGGING should be set to -2 in your case and can be verified like this

Code: Select all

cat /boot/dietpi/.installed |grep LOGG
INDEX_LOGGING_CURRENT=-2
INDEX_LOGGING_TARGET=-2
Using journalctl, you can verify if the hourly corn job was executed

Code: Select all

journalctl -u cron.service |grep hourly
Jul 16 20:17:01 DietPi3 CRON[1099]: (root) CMD (cd / && run-parts --report /etc/cron.hourly)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
FESyv
Posts: 12
Joined: Sat May 04, 2019 11:13 pm

Re: RamLog #2 not creating /root/logfile_storage

Post by FESyv »

the script, /etc/cron.hourly/dietpi still isn't being executed every hour.

cron service is running.

this line is in crontab: 17 * * * * root cd / && run-parts --report /etc/cron.hourly

seems it isn't being executed, thus /etc/cron.hourly/dietpi isn't run. i don't have any cron*.logs either. i put a couple [echo "$date-$time text" > file.txt] lines to see if cron.hourly/dietpi file executed. i will only see file.txt written to if i manually execute cron.hourly/dietpi and not via cron service.

any suggestions?
User avatar
Joulinar
Posts: 2072
Joined: Sat Nov 16, 2019 12:49 am

Re: RamLog #2 not creating /root/logfile_storage

Post by Joulinar »

is the cron service running?

Code: Select all

systemctl status cron.service
You can use dietpi-cron and re-apply the settings for the hourly run.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
FESyv
Posts: 12
Joined: Sat May 04, 2019 11:13 pm

Re: RamLog #2 not creating /root/logfile_storage

Post by FESyv »

yes, cron.service is running

Code: Select all

 sudo systemctl status cron

● cron.service - Regular background program processing daemon
   Loaded: loaded (/lib/systemd/system/cron.service; disabled; vendor preset: enabled)
   Active: active (running) since Thu 2020-07-16 13:34:40 PDT; 23h ago
     Docs: man:cron(8)
 Main PID: 7449 (cron)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/cron.service
           └─7449 /usr/sbin/cron -f
i ran dietpi-cron, set hourly time to 15 vs 17, saved, exited. checked syslog, cron is running and reloaded /etc/crontab.

i now see this in syslog:

Code: Select all

  Jul 17 13:15:01 rpixx CRON[21246]: (root) CMD (cd / && run-parts --report /etc/cron.hourly)
  Jul 17 14:15:01 rpixx CRON[21988]: (root) CMD (cd / && run-parts --report /etc/cron.hourly)
  Jul 17 15:15:01 rpixx CRON[22591]: (root) CMD (cd / && run-parts --report /etc/cron.hourly)
cron.hourly finally got executed!! thanks!
User avatar
Joulinar
Posts: 2072
Joined: Sat Nov 16, 2019 12:49 am

Re: RamLog #2 not creating /root/logfile_storage

Post by Joulinar »

probably it stuck somewhere, good that it is running now
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply