Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #208054
| From | David Wright <deblis@lionunicorn.co.uk> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: How do I trace changes in configuration files? |
| Date | 2019-05-02 22:20 +0200 |
| Message-ID | <xTqlr-65a-1@gated-at.bofh.it> (permalink) |
| References | <xSTSx-2Nt-7@gated-at.bofh.it> <xSVKF-3WH-1@gated-at.bofh.it> <xT0AF-6Wi-1@gated-at.bofh.it> <xTaA1-4M7-1@gated-at.bofh.it> <xTmBb-3LV-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu 02 May 2019 at 12:12:19 (-0400), Lee wrote:
> On 5/1/19, David Wright wrote:
> >
> > As for finding where the information went, I sometimes use
> > # find /boot /etc /home /lib /lib64 /var -type f -mmin -1440 -print | less #
> > one day
> > but changing 1440 to something more appropriate, like 10 (mins).
>
> You can use "find -newer" and not have to guess/remember how long ago
Sure, but most people can think, "I did this since having lunch,
so I know it was in the last 2 hours" ⇨ -mmin -150
> $ cat makets
> #!/bin/sh
> # create a timestamp file
> #
> # useful for finding files created after the timestamp
> # eg. find files created/modified after timestamp
> # find ${HOME} -newer /tmp/timestamp
> # find all files created/modified after timestamp
> # find /cygdrive/c -newer /tmp/timestamp
>
> TS=`date +%Y%m%d-%H%M`
> # 20160225-0734
>
> touch /tmp/timestamp /tmp/timestamp-${TS}
I prefer to have both bounds available:
find-between ()
{
[ -z "$3" ] && printf '%s\n' "Usage: $FUNCNAME timedate timedate top-of-trees...
finds files under top-of-trees with modification timestamps between
the two timedates given (free format, in any order). The output is
piped through ls -l -t into less." 1>&2 && return 1;
local Timea="$(date --rfc-3339=seconds --date "$1")";
[ -z "$Timea" ] && return 2;
local Timeb="$(date --rfc-3339=seconds --date "$2")";
[ -z "$Timeb" ] && return 2;
shift 2;
[ "$Timea" = "$Timeb" ] && printf '%s\n' "Times are the same (one minute resolution)" && return;
[ "$Timea" \> "$Timeb" ] && local Swap="$Timea" && Timea="$Timeb" && Timeb="$Swap";
printf '%s\n' "From $Timea to $Timeb";
local Unique="$(mktemp ${Uniquetrash:-/tmp}/$FUNCNAME-"$(date +%s)"-XXXX)";
local UniqueA="$(mktemp ${Uniquetrash:-/tmp}/$FUNCNAME-"$(date +%s)"-XXXX)";
local UniqueB="$(mktemp ${Uniquetrash:-/tmp}/$FUNCNAME-"$(date +%s)"-XXXX)";
touch -d "$Timea" "$UniqueA";
touch -d "$Timeb" "$UniqueB";
find "$@" -newer "$UniqueA" -a -not -newer "$UniqueB" -type f -print0 >> "$Unique";
[ -s "$Unique" ] && xargs -0 ls -l -t < "$Unique" | less;
rm "$UniqueA" "$UniqueB" "$Unique"
}
Cheers,
David.
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How do I trace changes in configuration files? Erik Josefsson <erik.hjalmar.josefsson@gmail.com> - 2019-05-01 11:40 +0200
Re: How do I trace changes in configuration files? Jonas Smedegaard <jonas@jones.dk> - 2019-05-01 13:00 +0200
Re: How do I trace changes in configuration files? Dan Purgert <dan@djph.net> - 2019-05-01 13:40 +0200
Re: How do I trace changes in configuration files? Erik Josefsson <erik.hjalmar.josefsson@gmail.com> - 2019-05-01 18:50 +0200
Re: How do I trace changes in configuration files? Dan Purgert <dan@djph.net> - 2019-05-01 19:30 +0200
Re: How do I trace changes in configuration files? Joe <joe@jretrading.com> - 2019-05-01 23:20 +0200
Re: How do I trace changes in configuration files? Jude DaShiell <jdashiel@panix.com> - 2019-05-02 00:10 +0200
Re: How do I trace changes in configuration files? David Wright <deblis@lionunicorn.co.uk> - 2019-05-02 05:30 +0200
Re: How do I trace changes in configuration files? Dan Purgert <dan@djph.net> - 2019-05-02 13:10 +0200
Re: How do I trace changes in configuration files? Lee <ler762@gmail.com> - 2019-05-02 18:20 +0200
Re: How do I trace changes in configuration files? David Wright <deblis@lionunicorn.co.uk> - 2019-05-02 22:20 +0200
Re: How do I trace changes in configuration files? Lee <ler762@gmail.com> - 2019-05-02 23:00 +0200
Re: How do I trace changes in configuration files? Andy Smith <andy@strugglers.net> - 2019-05-02 12:10 +0200
csiph-web