lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAFf+5zix1c=mfUBWW2tiz7KkNsPmPOBgmFcHZd8HLtOVn3sAGw@mail.gmail.com>
Date: Thu, 8 Jan 2026 10:54:02 +0530
From: Amit <amitchoudhary0523@...il.com>
To: linux-kernel@...r.kernel.org
Subject: Bash scripts for taking backups of files and comparing the current
 file with the latest backed up version of the file.

Bash scripts for taking backups of files and comparing the current
file with the latest backed up version of the file.

-------------------
mybackup.sh
-------------------
--------------------------------------------------------------------------------------------
#!/bin/bash

backup_dir=~/backups

date=`date "+%Y-%m-%d-%H-%M-%S"`

set -x

cp $1 $backup_dir/$1.$date
--------------------------------------------------------------------------------------------

Example usage: mybackup.sh myfile.c

-------------------------------------------------------------------
compare_file_with_lastest_backed_up_version.sh
-------------------------------------------------------------------
--------------------------------------------------------------------------------------------
#!/bin/bash

ls -tr -1 ~/backups/$1.*

last=`ls -tr -1 ~/backups/$1.* | tail -n 1`

echo

set -x

diff -u $last $1
--------------------------------------------------------------------------------------------

Example usage: compare_file_with_lastest_backed_up_version.sh myfile.c

----

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ