[arm-allstar] Log
Doug Crompton
wa3dsp at gmail.com
Mon Mar 4 02:59:52 EST 2019
Luc,
If you want to do all these things with Linux I think you need to get some
help up there or read up on it.
Here are the basics -
You need to bring up devmon as a service on your Pi. This will ensure it
will mount the USB stick at boot. Here is the procedure at the Linux prompt
-
systemctl enable devmon at root.service
systemctl start devmon at root.service
Now when you boot devmon will be running. You do NOT need to have a devmon
startup in your /etc/rc.local file. If it is there take it out.
Reboot with the USB stick inserted. Then do a DF and you should see the
mounted stick. Here is an example -
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 3762048 1639280 1911948 47% /
devtmpfs 474584 0 474584 0% /dev
tmpfs 479192 0 479192 0% /dev/shm
tmpfs 479192 48236 430956 11% /run
tmpfs 479192 0 479192 0% /sys/fs/cgroup
tmpfs 479192 356 478836 1% /tmp
tmpfs 51200 2948 48252 6% /var/log
/dev/mmcblk0p1 102182 19898 82284 20% /boot
/dev/sda1 59374732 1956528 54379024 4% /media/MS1
tmpfs 95840 0 95840 0% /run/user/0
The /dev/sda1 is the stick. I have labelled the stick MS1 and it mounts by
default under /media - your stick may be labelled something else. You can
format and relabel easily with Linux Gparted on a graphical system -
ubuntu, Raspbien, etc. BTW this is a 32G stick and it has been logging My
busy hub for several years. No audio logging but still it has only used 4%
of the stick!
# du -h /media/MS1/27225
1.9G /media/MS1/27225
Then I think all you need to do is add a symbolic link -
ln -s /media/log/asterisk /var/log/asterisk To put all of the Asterisk
stuff on the USB stick or
ln -s /media/log/asterisk/some_file /var/log/asterisk/somefile - for just
a specific file
When you do this the stuff that is on the tmpfile system (RAM) will be lost
just like it would if you rebooted. From this point on it will be stored on
the non-volatile USB stick.
VERY IMPORTANT!
Remember if you do this you need to have the USB stick installed and
formatted - ext4
It also needs to be there at all times when the system is running. If you
need to remove it to read somewhere else shut the system down first and
reinstall it before you bring the system up.
Technically you could put all /var/log/* on the USB stick but doing so
could lead to system problems if the stick was for some reason (error, not
installed, etc) not available. I do use USB sticks but I have not offloaded
any logs. If something goes wrong in doing this you could always insert the
card in a reader and on a Linux system (another Pi) mount the SD card and
delete the link and it would be back to the original system.
As I said in the beginning if you want to do these things you either need
to enlist some local help or read up on how to do it.
*73 Doug*
*WA3DSP*
*http://www.crompton.com/hamradio <http://www.crompton.com/hamradio>*
On Sun, Mar 3, 2019 at 9:39 PM Luc Drolet VE2LUQ <ldrolet at cgocable.ca>
wrote:
> Hi Doug,
>
> Yes, I actually have some USB keys on all my repeaters
> and I was never able to do my log on the usb key that is install on each
> raspberry PI
>
> every time I do a reboot I do this command
> mkdir/var log/asterisk/cdr-csv
> to reactivate my log
>
> but if there is a solution to have my log on the usb key I am very
> interested to know how
>
> thanks for your help
>
> 73’s
> Luc
>
> > Le 3 mars 2019 à 21:29, Doug Crompton via ARM-allstar <
> arm-allstar at hamvoip.org> a écrit :
> >
> > Luc,
> >
> > /var/log/* is by default written to a tmpfile system meaning RAM so it is
> > volatile at boot, We do not do any large repetitive writes to the SD
> card.
> > I though you had a USB stick you were writing to? I thought you
> > symbolically linked the logs to it. Didn't we go over this before?
> >
> >
> > *73 Doug*
> >
> > *WA3DSP*
> >
> > *http://www.crompton.com/hamradio <http://www.crompton.com/hamradio>*
> >
> > On Sun, Mar 3, 2019 at 9:25 PM "Luc Drolet VE2LUQ via ARM-allstar" <
> > arm-allstar at hamvoip.org> wrote:
> >
> >> Hello everyone,
> >>
> >> I have a small problem
> >> every time I do a reboot I lose my give in
> >> /var/log/asterisk/cdr-csv/master.csv
> >> and if I do a reload everything is OK, I always have my information in
> >> /var/log/asterisk/cdr-csv/master.csv
> >>
> >> do you have an idea how to make my reboot and without losing my info
> >>
> >> Thank you and good evening
> >>
> >> 73’s
> >> Luc
> >> _______________________________________________
> >>
> >> ARM-allstar mailing list
> >> ARM-allstar at hamvoip.org
> >> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
> >>
> >> Visit the BBB and RPi2/3 web page - http://hamvoip.org
> > _______________________________________________
> >
> > ARM-allstar mailing list
> > ARM-allstar at hamvoip.org
> > http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
> >
> > Visit the BBB and RPi2/3 web page - http://hamvoip.org
>
>
More information about the ARM-allstar
mailing list