i want to filter the last command output to last "x" hours, it can be 1 hr or 2yr etc. i used everything grep/sed/awk but nothing is helping me out - linux

tried this grep but it will give only specific hours details.
last -n -x reboot shutdown | sed -n "/$(date --date='0 hours ago' '+%a %b %d %H')/,\${/$(date --date='12 hours ago' '+%a %b %d %H')/q;p}"
reboot system boot 3.10.0-1062.el7. Tue Jun 23 06:21 - 09:18 (02:56)
reboot system boot 3.10.0-1062.el7. Tue Jun 23 06:14 - 09:18 (03:03)
reboot system boot 3.10.0-1062.el7. Tue Jun 23 06:05 - 09:18 (03:12)
reboot system boot 3.10.0-1062.el7. Tue Jun 23 05:52 - 09:18 (03:25)
reboot system boot 3.10.0-1062.el7. Tue Jun 23 05:19 - 09:18 (03:58)
shutdown system down 3.10.0-1062.el7. Tue Jun 23 05:19 - 05:19 (00:00)
reboot system boot 3.10.0-1062.el7. Mon Jun 22 12:29 - 05:19 (16:49)
reboot system boot 3.10.0-1062.el7. Mon Jun 22 07:12 - 05:19 (22:07)
shutdown system down 3.10.0-1062.el7. Mon Jun 22 07:12 - 07:12 (00:00)
reboot system boot 3.10.0-1062.el7. Mon Jun 22 03:57 - 07:12 (03:14)
shutdown system down 3.10.0-1062.el7. Mon Jun 22 02:38 - 03:57 (01:18)
reboot system boot 3.10.0-1062.el7. Mon Jun 22 02:20 - 02:38 (00:18)
shutdown system down 3.10.0-1062.el7. Mon Jun 22 02:20 - 02:20 (00:00)
reboot system boot 3.10.0-1062.el7. Mon Jun 22 01:48 - 02:20 (00:32)
reboot system boot 3.10.0-1062.el7. Fri May 1 09:25 - 02:20 (51+16:55)
shutdown system down 3.10.0-1062.el7. Fri May 1 09:25 - 09:25 (00:00)
reboot system boot 3.10.0-1062.el7. Fri May 1 09:24 - 09:25 (00:00)
shutdown system down 3.10.0-1062.el7. Wed Jan 15 09:25 - 09:24 (106+22:59)

Just specify the period to last
last --since -2hours

Related

Reason for one of the scripts not getting executed in crontab, after a crash event in a NUC system

"launcher.sh" is invoked upon every reboot of the system (done through crontab)
In the launcher.sh, a main python script, a memory monitoring python script are invoked.
It works perfectly fine. Even upon reboot also, both the python scripts are getting executed successfully.
One day, by mistake, the NUC system (in which the scripts are running) power button was pressed accidentally(March 16, 12:10 pm). After that, the system gets rebooted; Only the memory monitoring python script was getting executed; Not the main python script.
(i) Can someone help us to understand the reason for this observation?
FYI: Later on, the system is restarted intensionally; Since then, it works fine. (Both the scripts are getting executed)
Pulled out the "last" and "last reboot" results from that system. Please find below:
'''
last reboot
reboot system boot 4.15.0-1094-oem Sun Mar 21 06:01 still running
reboot system boot 4.15.0-1094-oem Thu Mar 18 14:05 - 06:01 (2+15:56)
reboot system boot 4.15.0-1094-oem Mon Mar 15 11:42 - 06:01 (5+18:18)
reboot system boot 4.15.0-1094-oem Sun Mar 14 06:01 - 06:01 (6+23:59)
reboot system boot 4.15.0-1094-oem Thu Mar 11 16:55 - 06:01 (2+13:06)
reboot system boot 4.15.0-1094-oem Mon Mar 8 10:39 - 16:54 (3+06:15)
reboot system boot 4.15.0-1094-oem Sun Mar 7 06:01 - 10:37 (1+04:35)
reboot system boot 4.15.0-1094-oem Sat Mar 6 10:27 - 06:01 (19:33)
reboot system boot 4.15.0-1094-oem Mon Mar 1 14:40 - 10:25 (4+19:45)
reboot system boot 4.15.0-1094-oem Mon Mar 1 11:14 - 14:39 (03:25)
last
linuxdev :0 :0 Sun Mar 21 06:02 still logged in
reboot system boot 4.15.0-1094-oem Sun Mar 21 06:01 still running
linuxdev :0 :0 Thu Mar 18 14:05 - 06:01 (2+15:55)
reboot system boot 4.15.0-1094-oem Thu Mar 18 14:05 - 06:01 (2+15:56)
linuxdev :0 :0 Tue Mar 16 12:11 - crash (2+01:53)
linuxdev :0 :0 Mon Mar 15 11:42 - 12:10 (1+00:27)
reboot system boot 4.15.0-1094-oem Mon Mar 15 11:42 - 06:01 (5+18:18)
linuxdev :0 :0 Sun Mar 14 06:02 - crash (1+05:39)
reboot system boot 4.15.0-1094-oem Sun Mar 14 06:01 - 06:01 (6+23:59)
linuxdev :0 :0 Thu Mar 11 16:55 - down (2+13:05)
reboot system boot 4.15.0-1094-oem Thu Mar 11 16:55 - 06:01 (2+13:06)
linuxdev :0 :0 Mon Mar 8 10:40 - down (3+06:14)
reboot system boot 4.15.0-1094-oem Mon Mar 8 10:39 - 16:54 (3+06:15)
linuxdev :0 :0 Sun Mar 7 06:02 - down (1+04:34)
reboot system boot 4.15.0-1094-oem Sun Mar 7 06:01 - 10:37 (1+04:35)
linuxdev :0 :0 Sat Mar 6 10:28 - down (19:32)
reboot system boot 4.15.0-1094-oem Sat Mar 6 10:27 - 06:01 (19:33)
linuxdev :0 :0 Mon Mar 1 14:40 - down (4+19:45)
reboot system boot 4.15.0-1094-oem Mon Mar 1 14:40 - 10:25 (4+19:45)
linuxdev :0 :0 Mon Mar 1 11:14 - down (03:24)
reboot system boot 4.15.0-1094-oem Mon Mar 1 11:14 - 14:39 (03:25)
'''
A follow up question, (ii) when will we observe "crash" in "last" command?

How to find which process periodicitly write to a file?

There is a file in /tmp/echo_test.txt, and some process periodicitly write timestamp to this file one minute.
I checked process list and crontab, but found nothing. Is there a way to find the process quickily?
Thanks you.
My OS is Centos 6, the text like below:
Mon Oct 19 10:47:01 CST 2020
Mon Oct 19 10:48:01 CST 2020
Mon Oct 19 10:49:01 CST 2020
Mon Oct 19 10:50:01 CST 2020
Mon Oct 19 10:51:01 CST 2020
Mon Oct 19 10:52:01 CST 2020
If it's a single, continuous process, lsof or fuser should help.
Otherwise, it's probably a cron job or at job, or someone put together a while loop with a sleep 60 in it that's fork+exec'ing.

How can I customise an ISO image of Webconverger with a Linux shell script?

I want to write a simple shell script that downloads the latest ISO image of Webconverger and changes the boot parameters of grub in /boot/live.cfg.
So this is what I have done so far:
#!/bin/bash
# 1. Download the ISO
wget https://build.webconverger.com/latest.iso
# 2. Mount the ISO and create a development folder
sudo mkdir /mnt/webconverger
sudo mount -o loop latest.iso /mnt/webconverger
mkdir devfolder
rsync -av /mnt/webconverger/ devfolder/
sudo umount /mnt/webconverger
sudo rm -r /mnt/webconverger
# 3. Change the file in the development folder.
chmod -R 777 devfolder/
rm devfolder/boot/live.cfg
echo \
"DEFAULT de
label de
menu label Start
kernel /live/vmlinuz
append initrd=/live/initrd.img boot=live skipconfig quiet splash components=gitfs net.ifnames=0 bootfrom=removable locale=de xkb=-layout%20de homepage=https://www.google.de/" \
> devfolder/boot/live.cfg
# 4. Create a new ISO image
mkisofs -o new.iso -l devfolder
rm -r devfolder/
The generated ISO does not boot.
I asume the reasons for the problem are, that I had to run the whole script with root privileges and that I need a more complex mkisofs command.
Does anybody know how to generate a proper ISO image for Webconverger with a shell script? Or is there an alternative method for the whole process? Something like ISO Master but for the command line?
Update
I have replaced the code snippets with the actual shell script. So it is easier to test. And here is the command line output (without the wget part):
mount: /dev/loop0 is write-protected, mounting read-only
sending incremental file list
./
boot/
boot/boot.bin
boot/boot.cat
boot/live.cfg
boot/syslinux/
boot/syslinux/ldlinux.c32
boot/syslinux/libcom32.c32
boot/syslinux/libutil.c32
boot/syslinux/splash.png
boot/syslinux/syslinux.cfg
boot/syslinux/vesainfo.c32
boot/syslinux/vesamenu.c32
live/
live/initrd.img
live/vmlinuz
live/filesystem.git/
live/filesystem.git/HEAD
live/filesystem.git/config
live/filesystem.git/description
live/filesystem.git/packed-refs
live/filesystem.git/shallow
live/filesystem.git/branches/
live/filesystem.git/hooks/
live/filesystem.git/hooks/applypatch-msg.sample
live/filesystem.git/hooks/commit-msg.sample
live/filesystem.git/hooks/post-update.sample
live/filesystem.git/hooks/pre-applypatch.sample
live/filesystem.git/hooks/pre-commit.sample
live/filesystem.git/hooks/pre-push.sample
live/filesystem.git/hooks/pre-rebase.sample
live/filesystem.git/hooks/pre-receive.sample
live/filesystem.git/hooks/prepare-commit-msg.sample
live/filesystem.git/hooks/update.sample
live/filesystem.git/info/
live/filesystem.git/info/exclude
live/filesystem.git/objects/
live/filesystem.git/objects/info/
live/filesystem.git/objects/pack/
live/filesystem.git/objects/pack/pack-1aa978c13266848f4644754d1875dc90ec4bfcdb.idx
live/filesystem.git/objects/pack/pack-1aa978c13266848f4644754d1875dc90ec4bfcdb.pack
live/filesystem.git/refs/
live/filesystem.git/refs/heads/
live/filesystem.git/refs/heads/master
live/filesystem.git/refs/remotes/
live/filesystem.git/refs/remotes/origin/
live/filesystem.git/refs/remotes/origin/HEAD
live/filesystem.git/refs/tags/
live/filesystem.git/refs/tags/initial-revision
sent 598,528,659 bytes received 726 bytes 239,411,754.00 bytes/sec
total size is 598,380,033 speedup is 1.00
I: -input-charset not specified, using utf-8 (detected in locale settings)
1.71% done, estimate finish Tue Jul 10 20:12:54 2018
3.42% done, estimate finish Tue Jul 10 20:12:54 2018
5.13% done, estimate finish Tue Jul 10 20:13:13 2018
6.84% done, estimate finish Tue Jul 10 20:13:08 2018
8.55% done, estimate finish Tue Jul 10 20:13:05 2018
10.26% done, estimate finish Tue Jul 10 20:13:03 2018
11.97% done, estimate finish Tue Jul 10 20:13:02 2018
13.68% done, estimate finish Tue Jul 10 20:13:01 2018
15.39% done, estimate finish Tue Jul 10 20:13:00 2018
17.10% done, estimate finish Tue Jul 10 20:12:59 2018
18.81% done, estimate finish Tue Jul 10 20:12:59 2018
20.52% done, estimate finish Tue Jul 10 20:12:58 2018
22.23% done, estimate finish Tue Jul 10 20:12:58 2018
23.94% done, estimate finish Tue Jul 10 20:12:58 2018
25.65% done, estimate finish Tue Jul 10 20:12:57 2018
27.36% done, estimate finish Tue Jul 10 20:12:57 2018
29.07% done, estimate finish Tue Jul 10 20:12:57 2018
30.78% done, estimate finish Tue Jul 10 20:12:57 2018
32.49% done, estimate finish Tue Jul 10 20:12:57 2018
34.20% done, estimate finish Tue Jul 10 20:12:56 2018
35.91% done, estimate finish Tue Jul 10 20:12:56 2018
37.62% done, estimate finish Tue Jul 10 20:12:56 2018
39.33% done, estimate finish Tue Jul 10 20:12:56 2018
41.04% done, estimate finish Tue Jul 10 20:12:56 2018
42.75% done, estimate finish Tue Jul 10 20:12:56 2018
44.46% done, estimate finish Tue Jul 10 20:12:56 2018
46.17% done, estimate finish Tue Jul 10 20:12:56 2018
47.88% done, estimate finish Tue Jul 10 20:12:56 2018
49.59% done, estimate finish Tue Jul 10 20:12:56 2018
51.30% done, estimate finish Tue Jul 10 20:12:55 2018
53.02% done, estimate finish Tue Jul 10 20:12:55 2018
54.72% done, estimate finish Tue Jul 10 20:12:55 2018
56.44% done, estimate finish Tue Jul 10 20:12:55 2018
58.14% done, estimate finish Tue Jul 10 20:12:55 2018
59.86% done, estimate finish Tue Jul 10 20:12:55 2018
61.56% done, estimate finish Tue Jul 10 20:12:55 2018
63.28% done, estimate finish Tue Jul 10 20:12:55 2018
64.98% done, estimate finish Tue Jul 10 20:12:55 2018
66.70% done, estimate finish Tue Jul 10 20:12:55 2018
68.40% done, estimate finish Tue Jul 10 20:12:55 2018
70.12% done, estimate finish Tue Jul 10 20:12:55 2018
71.82% done, estimate finish Tue Jul 10 20:12:55 2018
73.54% done, estimate finish Tue Jul 10 20:12:55 2018
75.24% done, estimate finish Tue Jul 10 20:12:55 2018
76.96% done, estimate finish Tue Jul 10 20:12:55 2018
78.66% done, estimate finish Tue Jul 10 20:12:55 2018
80.38% done, estimate finish Tue Jul 10 20:12:55 2018
82.08% done, estimate finish Tue Jul 10 20:12:55 2018
83.80% done, estimate finish Tue Jul 10 20:12:55 2018
85.50% done, estimate finish Tue Jul 10 20:12:55 2018
87.22% done, estimate finish Tue Jul 10 20:12:55 2018
88.92% done, estimate finish Tue Jul 10 20:12:55 2018
90.64% done, estimate finish Tue Jul 10 20:12:55 2018
92.34% done, estimate finish Tue Jul 10 20:12:55 2018
94.06% done, estimate finish Tue Jul 10 20:12:55 2018
95.76% done, estimate finish Tue Jul 10 20:12:55 2018
97.48% done, estimate finish Tue Jul 10 20:12:55 2018
99.18% done, estimate finish Tue Jul 10 20:12:55 2018
Total translation table size: 0
Total rockridge attributes bytes: 0
Total directory bytes: 30720
Path table size(bytes): 222
Max brk space used 2b000
292387 extents written (571 MB)
And this what I get in VirtualBox:
Click here!
So the full answer to the question is:
#!/bin/bash
# 1. Download the ISO
wget https://build.webconverger.com/latest.iso
# 2. Mount the ISO and create a development folder
sudo mkdir /mnt/webconverger
sudo mount -o loop latest.iso /mnt/webconverger
mkdir devfolder
rsync -av /mnt/webconverger/ devfolder/
sudo umount /mnt/webconverger
sudo rm -r /mnt/webconverger
# 3. Change the file in the development folder.
echo \
"DEFAULT de
label de
menu label Start
kernel /live/vmlinuz
append initrd=/live/initrd.img boot=live skipconfig quiet splash components=gitfs net.ifnames=0 bootfrom=removable locale=de xkb=-layout%20de homepage=https://duckduckgo.com nobrand" \
| sudo tee devfolder/boot/live.cfg
# 4. Create a new ISO image
sudo mkisofs -r -J -l -V "Webconverger" -b boot/boot.bin -c boot/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o new.iso devfolder
sudo isohybrid new.iso
sudo rm -r devfolder/
For some reason dd did not work for Webconverger images. Even the with the untouched latest.iso it was not possible to create a bootable USB flash drive. So I used Win32DiskImager.
What you want to do is to generate an El Torito bootable CD with an MBR in its first bytes.
mkisofs(8) needs some special options to create an "El Torito" bootable CD:
mkisofs -r -J -l -V "Webconverger" -b boot/boot.bin -c boot/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o new.iso devfolder
Explaination:
-r -J: Enable Joliet and Rock Ridge meta data.
-l: Allow long filenames.
-V: Set volume ID. Optional.
-b: Specify the "El Torito" boot image.
-c: Specify the "El Torito" boot catalog.
-no-emul-boot: Specify that this is an "El Torito" bootable CD.
-boot-load-size: number of 512 bytes sector to load (4 is what usually works)
-boot-info-table: modify the original boot image appending the Boot Info Table
Then, if you want to be able to just dd the file on a USB drive you will need to write an MBR onto the ISO:
isohybrid new.iso

(unknown) user is always logged in my centos linux machine

I was going through logged in user in to my system using who command what i found is very surprising a user named unknown is logged in
Result of command who :
myuser pts/1 Aug 6 20:27 (localhost)
(unknown) :0 Aug 5 16:25 (:0)
myuser pts/0 Aug 6 00:48 (localhost.localdomain)
But when i tried running w it results different:
20:46:53 up 1 day, 23:11, 3 users, load average: 1.00, 1.01, 1.05
USER TTY FROM LOGIN# IDLE JCPU PCPU WHAT
myuser pts/1 localhost 20:27 5.00s 0.20s 0.03s w
myuser pts/0 localhost.locald 00:48 19:57m 0.08s 1.71s python2 -m guake.main
I am neither able to find any user on my machine named unknown. On trying sudo su unknown/"(unknown)"
I tried running last it shows unknown user still logged in
myuser pts/1 localhost Thu Aug 6 20:27 still logged in
myuser pts/2 :pts/1:S.0 Thu Aug 6 20:15 - 20:16 (00:00)
myuser pts/1 localhost Thu Aug 6 20:03 - 20:18 (00:15)
myuser pts/2 :pts/1:S.0 Thu Aug 6 19:49 - 19:49 (00:00)
myuser pts/1 localhost Thu Aug 6 19:47 - 19:49 (00:02)
myuser pts/1 localhost Thu Aug 6 19:37 - 19:46 (00:09)
myuser pts/1 localhost Thu Aug 6 19:33 - 19:37 (00:03)
myuser pts/1 :9 Thu Aug 6 19:32 - 19:33 (00:00)
myuser pts/1 localhost Thu Aug 6 19:26 - 19:32 (00:05)
myuser pts/2 :pts/1:S.0 Thu Aug 6 19:22 - 19:22 (00:00)
myuser pts/1 localhost Thu Aug 6 19:22 - 19:22 (00:00)
myuser pts/2 :pts/1:S.0 Thu Aug 6 19:15 - 19:16 (00:00)
myuser pts/1 localhost Thu Aug 6 19:15 - 19:16 (00:00)
myuser pts/2 :pts/1:S.0 Thu Aug 6 19:13 - 19:13 (00:00)
myuser pts/1 localhost Thu Aug 6 19:13 - 19:13 (00:00)
myuser pts/2 :pts/1:S.0 Thu Aug 6 19:12 - 19:13 (00:00)
myuser pts/2 :pts/1:S.0 Thu Aug 6 19:11 - 19:11 (00:00)
myuser pts/2 :pts/1:S.0 Thu Aug 6 19:10 - 19:10 (00:00)
myuser pts/1 localhost Thu Aug 6 18:37 - 19:13 (00:35)
myuser pts/1 localhost Thu Aug 6 18:17 - 18:21 (00:03)
myuser pts/1 localhost Thu Aug 6 18:09 - 18:13 (00:03)
myuser pts/0 localhost.locald Thu Aug 6 00:48 still logged in
myuser pts/0 localhost.locald Thu Aug 6 00:34 - 00:48 (00:14)
myuser pts/1 :9 Wed Aug 5 23:01 - 23:01 (00:00)
myuser pts/0 localhost.locald Wed Aug 5 22:00 - 00:34 (02:34)
myuser pts/0 localhost Wed Aug 5 21:06 - 21:06 (00:00)
myuser pts/0 localhost Wed Aug 5 20:57 - 20:59 (00:01)
myuser pts/0 localhost Wed Aug 5 20:56 - 20:56 (00:00)
myuser pts/0 localhost Wed Aug 5 20:56 - 20:56 (00:00)
myuser pts/0 :9 Wed Aug 5 20:55 - 20:56 (00:00)
myuser pts/4 localhost Wed Aug 5 20:14 - 20:55 (00:40)
myuser pts/4 localhost Wed Aug 5 20:11 - 20:12 (00:00)
myuser pts/5 localhost Wed Aug 5 19:52 - 19:56 (00:04)
myuser pts/4 localhost Wed Aug 5 19:29 - 19:31 (00:02)
myuser pts/2 localhost Wed Aug 5 18:42 - 19:32 (00:49)
myuser pts/2 localhost Wed Aug 5 18:42 - 18:42 (00:00)
myuser pts/3 :9 Wed Aug 5 18:38 - 18:42 (00:04)
myuser pts/3 localhost Wed Aug 5 16:28 - 16:28 (00:00)
myuser pts/2 :9 Wed Aug 5 16:26 - 16:28 (00:02)
(unknown :0 :0 Wed Aug 5 16:25 still logged in
Any idea how ?
I faced a similar problem some time ago on a Fedora host.
In my case, i found it was the X system that created a wrong entry in /var/run/utmp.
Here the link to the page.
Maybe you are not using Fedora but I suggest to try disable X and check if you still have an (unknown) user logged in.
Hope this helps.
I saw this appearing in a Fedora installation in the past, when I launched the X from a tty (not in init 5)
In red hat, there is a bug open related to this problem here (but maybe you are not even running a red hat based distro)
Take a look on it, there are some possible explanations, but depends on what you are running in your box

Command not found even crontab PATH is set

Even though I set the PATH in /etc/crontab as
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/lib/mailman/cron:/usr/lib/mailman/bin
commands found in /usr/lib/mailman/cron are still not found, Thus issuing a mail to root saying
/bin/sh: mailman: command not found
I've debugged the problem, setting up a cron entry
* * * * * /bin/echo "`/bin/date`: $PATH" >> /tmp/crontest.log 2>&1
using crontab -e which actually do write the PATH to /tmp/crontest.log, confirming that the path entered in /etc/crontab is not what cron think it should be.
Fri Feb 14 10:22:01 CET 2014: /usr/bin:/bin
I've also tried to solve it by re-start cron using (both) service crond restart and service crond stop;sleep 5;service crond start (which does the same, but to make absolutely certain that it has been restarted), but this doesn't change anything.
The /etc/crontab file is readable by everyone (permissions is 644 root root)
-rw-r--r-- 1 root root 500 10 feb 10:36 /etc/crontab
/var/log/cron does not show anything about the problem, just what's started and when I restarted the cron
grep -v CMD /var/log/cron
.
.
.
Feb 14 09:45:34 p1kitlst01l crond[12214]: (CRON) INFO (running with inotify support)
Feb 14 09:45:34 p1kitlst01l crond[12214]: (CRON) INFO (#reboot jobs will be run at computer's startup.)
Feb 14 09:48:07 p1kitlst01l crontab[12331]: (root) BEGIN EDIT (root)
Feb 14 09:48:45 p1kitlst01l crontab[12331]: (root) REPLACE (root)
Feb 14 09:48:45 p1kitlst01l crontab[12331]: (root) END EDIT (root)
Feb 14 09:49:01 p1kitlst01l crond[12214]: (root) RELOAD (/var/spool/cron/root)
Feb 14 10:01:01 p1kitlst01l run-parts(/etc/cron.hourly)[13010]: starting 0anacron
Feb 14 10:01:01 p1kitlst01l run-parts(/etc/cron.hourly)[13027]: finished 0anacron
Feb 14 10:01:01 p1kitlst01l run-parts(/etc/cron.hourly)[13010]: starting mcelog.cron
Feb 14 10:01:01 p1kitlst01l run-parts(/etc/cron.hourly)[13039]: finished mcelog.cron
Feb 14 10:19:16 p1kitlst01l crontab[13840]: (root) BEGIN EDIT (root)
Feb 14 10:19:23 p1kitlst01l crontab[13840]: (root) END EDIT (root)
Feb 14 10:27:17 p1kitlst01l crond[14170]: (CRON) STARTUP (1.4.4)
Feb 14 10:27:17 p1kitlst01l crond[14170]: (CRON) INFO (running with inotify support)
Feb 14 10:27:17 p1kitlst01l crond[14170]: (CRON) INFO (#reboot jobs will be run at computer's startup.)
Any suggestions to what I have to look in to?
Henrik
What I think is ,you have two ways to go (maybe others provide more).
1) set the absolute path for mailman in your script.
2) source the .profile, then run the script, such as:
0 1 * * * . ~/.profile; bash your_script.sh

Resources