AnswerBun.com

How to see full cron log (Not of just 1 day or less)?

Ask Ubuntu Asked by Sagun Shrestha on December 13, 2020

I want see all the jobs that has been scheduled by using cron for the last 1 week (or certain specified time). I used the command

sudo grep CRON /var/log/syslog

But it only shows the log for 1 day. Is there any command in Ubuntu to track them?

3 Answers

You can do this to newer syslog files:

cd /var/log
cat syslog.1 syslog | grep CRON

To the oldest you must do it:

cd /var/log
zcat syslog syslog.4.gz syslog.3.gz syslog.2.gz | grep CRON

It's a good idea to do these commands nested in loops, specially to zcat, since syslog.#.gz are more numerous.

You can even store them into another file to analyze better:

cd /var/log
zcat syslog syslog.4.gz syslog.3.gz syslog.2.gz | grep CRON > ~/cronanalysis.txt
cat syslog.1 syslog | grep CRON >> ~/cronanalysis.txt

The order of syslog files is inverted, so you put older to head and newer events to tail.

Correct answer by Redbob on December 13, 2020

On Amazon Linux you can find it in /var/log/cron file

tail /var/log/cron

Answered by Ravi Sethia on December 13, 2020

Another alternative is

sudo zgrep CRON /var/log/syslog*

zgrep uncompresses files if needed. Options same as for grep.

Answered by Wirewrap on December 13, 2020

Add your own answers!

Related Questions

Handbrake can’t access my video files

2  Asked on February 12, 2021 by roger06

   

Ubuntu on Hyper-V sluggish/slow UI experience

0  Asked on February 12, 2021 by bartek

       

Dell XPS 15 9570 – How to control the fans?

3  Asked on February 12, 2021 by j-ehrling

       

Freedesktop.org Failure

2  Asked on February 11, 2021 by garry-wakely

     

HP Pavillion x2 10.1 detachable

1  Asked on February 11, 2021 by daman-boparai

 

Stuck in emergency mode 20.10

0  Asked on February 11, 2021 by raj-verma

 

How to find /etc/apt/sources.conf file

2  Asked on February 11, 2021

 

Ubuntu 20.04 ImportError: No module named gtk.glade

1  Asked on February 10, 2021 by kyeiv

     

Can’t install software using package manager

0  Asked on February 10, 2021 by rachid-bensaleh

 

(Ubuntu 20.04) Port forwarding for Minecraft server

0  Asked on February 10, 2021 by mason-spies

 

Both Internet and Wifi not working on Ubuntu 20.04

0  Asked on February 10, 2021 by maxclac

   

Bluetooth doesn’t work anymore

0  Asked on February 9, 2021 by gogo94210

     

Multiple Partitions under /home and mount it as /home

0  Asked on February 9, 2021 by sriram-rayadurg

 

Installing Ubuntu on a new computer

1  Asked on February 9, 2021 by wassap124

     

Mouse sensitivity reset after replugging

0  Asked on February 8, 2021 by lehdari

         

Media keys running gnome-session-quit

0  Asked on February 8, 2021 by pineapplefan

     

(gedit:76): Gtk-WARNING

2  Asked on February 8, 2021 by manish-kumar

         

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP