Find files between specific times using find

Problem

You would like to find the files modified between certain times using find

Solution

Use the following find command using the -newerXY parameter to specify times you want to look for (ie betwen 2019-09-23 06:00:00 and 2019-09-23 10:00:00)

find . -type f -newermt "2019-09-23 06:00:00" ! -newermt "2019-09-23 10:00:00" | xargs ls -tral

Problems using snap autossh

Problem

You would like to use autossh to keep a connection open (ie database) between two hosts, but while the ssh equivalent command to start a tunnel works, the autossh does not.

You might be seeing the following errors (using AUTOSSH_DEBUG=1):

autossh[7471]: ssh exited prematurely with status 255; autossh exiting

or if you look at /var/logs/syslog you could also see entries like the following:

 apparmor="DENIED" operation="open" profile="snap.autossh.autossh" name="/home/autossh/.ssh/id_rsa.pub" pid=7447 comm="ssh" requested_mask="r" denied_mask="r" fsuid=1002 ouid=1002

Solution

You have used snap to install autossh which is not allowed by apparmor.

Remove the snap package and install autossh as a normal debian package:

sudo snap remove autossh
sudo apt install autossh