Sponsored Content
Full Discussion: maintain database script...
Top Forums UNIX for Dummies Questions & Answers maintain database script... Post 302350795 by Radar on Saturday 5th of September 2009 11:39:58 AM
Old 09-05-2009
So you want to baseline a set of files with a checksum and track changes to those files by checking against the checksums stored in the database?

Look at Afick and AIDE for examples to get you going.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Maintain 30 days data

Hi Folks, I have a log file that keeps the information pn the date and time a specific transaction is firedup. I found that the log file keeps growing and I intend to limit the entry to the log file to 30 days. Log file name is transaction.log, here is the content: 120802_23:47:37 ... (3 Replies)
Discussion started by: odogbolu98
3 Replies

2. Shell Programming and Scripting

Shell Script: want to insert values in database when update script runs

Hi , I am new to linux and also also to shell scripting. I have one shell script which unpacks .tgz file and install software on machine. When this script runs I want to insert id,filename,description(which will be in readme file),log(which will be in log file) and name of unpacked folder... (1 Reply)
Discussion started by: ring
1 Replies

3. Shell Programming and Scripting

Maintain full path of a script in a var when sourcing it from a different script

Hi All, I've searched through the forum for a solution to this problem, but I haven't found anything. I have 2 script files that are in different directories. My first script, let's call it "/one/two/a.sh" looks like this: #!/bin/sh IN_DIR=`dirname $0` CUR_DIR=`pwd` cd $IN_DIR... (4 Replies)
Discussion started by: mrbluegreen
4 Replies

4. Shell Programming and Scripting

How to maintain wildcard array variable

Hi all, I have this scenario where:- The file that I want to save its name into array df is my.08120323.trx which is located in the dir as below: $ pwd /u01/abc/def/SRC_datafiles $ ls *trx my.08120323.trx $ df=*"trx" ##keeping the filename my.08120323.trx into df $... (2 Replies)
Discussion started by: luna_soleil
2 Replies

5. UNIX for Dummies Questions & Answers

Just asking - Tips on how to maintain your scripts ..

Hi all, Just writing to ask if any one can advise on what tools to use best for maintaining your scripts ... preferably free/open source and portable if there is one, that is, one that can be placed and run on a USB stick ... At the moment, am having them in directories and files and no... (2 Replies)
Discussion started by: newbie_01
2 Replies

6. Shell Programming and Scripting

Log maintain in Perl

hi , While working on perl, have to write a continuous log file which I can monitor. I tried like, open (LOG,'>'.$log.'/Report_'.$todaysdate.'.log') or die("Unable to create the log file"); print LOG "\nDate : ".`date`; But when I ran the script in backend and monitor log, it... (1 Reply)
Discussion started by: Deei
1 Replies

7. Shell Programming and Scripting

maintain 32bit and 64bit C code

Hi, I have a C code which builds and works fine on 32bit linux machine. Now i want to convert that code to build and run on 64 bit linux machine. I dont want to maintain two separate sources for 32 and 64 bit build. Same source should get build on 32 as well as 64 bit machine (when a... (2 Replies)
Discussion started by: bhushan123
2 Replies

8. Shell Programming and Scripting

Script to maintain file versions

I am developing a script to maintain 'n' number of versions of a file. The script will take a filename as a parameter and the number of versions to maintain. This basically does something like a FIFO. Here is what I developed. But something is not right. I have attached the script. Can u pls help... (2 Replies)
Discussion started by: vskr72
2 Replies

9. UNIX for Dummies Questions & Answers

Script that will Delete and Maintain Files

Hi guys, Good day to all and Happy New Year!!! Cheers!!! I hope anyone could help/suggest me on hot to create a script that will monitor the directory where files are being dumped. I have a script in CRON that runs everyday and collect for logs with a filename of Output_$(date... (3 Replies)
Discussion started by: rymnd_12345
3 Replies

10. Shell Programming and Scripting

Script FTP maintain error handling

Hi, I have ftp script like below How to insert an error handling, If the transfer failed then send mail to me. Actually, I just need the script to send an email if the FTP failed. How to put the email script within FTP script? Thank You Edy (5 Replies)
Discussion started by: edydsuranta
5 Replies
shatag(1)							      Shatag								 shatag(1)

NAME
shatag - tag files with their SHA-256 checksums SYNOPSIS
shatag [-fhlLqrtuv0] [-d DATABASE] [-n NAME] [-R NAME]... [FILES]... DESCRIPTION
shatag is a tool for computing and caching SHA-256 file checksums, and efficiently search for identical file across systems. Checksums are stored using the POSIX Extended Attributes filesystem facility, and are preserved when files are moved or renamed. Checksums can be fetched from a remote host and stored in an sqlite database for fast lookups. OPTIONS
When invoked with no options, shatag just displays the cached, valid checksums. If no files are specified, it applies to all non-hidden files in the current directory. The output format is identical to the one of the sha256sum command. -0, --null Instead of outputting one record per line (like sha256sum does,) separate records with null characters. -d DATABASE, --database DATABASE Set the path of the SQLite database to query when using -l , -L or -p (The default path is $HOME/.shatagdb, overridable from the config file) Instead of a file name, a PostgreSQL database can be specified with a prefix of "pg:" followed by a psycopg2 DSN string, like: "pg:dbname=shatag user=myuser password=mypassword host=192.168.1.3" -f, --force When running with -t or -u , recompute the checksum even if the file modification time has not changed. If the old checksum differs, report the file as corrupted. -h, --help Displays the help message -l, --lookup Instead of displaying the checksums, look them up against the local database and indicate if the file exists. A yellow - mark indi- cates that the file does not exist somewhere else, a green = that the file exists at one or several remote locations, a red + that the file has a duplicate on the local system, and a magenta * that the file is empty. -L, --lookup-verbose Instead of displaying the checksums, look them up against the local database. Print all the known remote locations for identical files. -n NAME, --name NAME Name of local storage (defaults to canonical local host name). This needs to be correct if the local database contains entries for this own host. -p, --put Record found tags in the database, for duplicate detection. -q, --quiet Do not display the valid checksums when they are found. -r, --recursive Recurse trough subdirectories -R NAME, --remote NAME When using -l or -L , This is used to restrict the set of remote names to consider. If present, other storages will be ignored. -t, --tag Compute new checksums for files that don't have one, or when it is outdated. -u, --update Recompute the outdated checksums only. Be aware that this can behave counter-intuitively; outdated checksums will only exists for files that have been appended to or partially modified. Many programs dealing with small files (some well-known text editors, no- tably) will overwrite the whole file when saving, and the new file will be lacking a checksum entirely. For these cases, use -t in- stead. -v, --verbose Report encoutered files that have an outated or missing checksum. EXAMPLES
Retag a whole directory and record everything to the database: shatag -pqrt . Check files in the current directory for remote duplicates: shatag -l Show alternate locations for duplicates of a single file: shatag -L somefile FILES
~/.shatagrc YAML configuration file. Currently has only two possible configuration keys: "database", which sets the database path (by default, ~/.shatagdb) and "name" for the volume name in the database (default to canonical host name.) Examples: database: /var/lib/shatag.db # sqlite3 backend database: "pg: dbname=shatag host=localhost user=shatag password=xxxsecretpass- wordxxx" # postgres backend database: http://service.com/shatag # http backend database: insecure-https://service.com/shatag # http backend, skip ssl certificate verification BUGS
Support for non-ASCII filenames across systems of different and/or inconsistent encodings have not been fully tested. Not all option combinations are sensible. REPORTING BUGS
Report shatag bugs to the bugtracker at http://bitbucket.org/maugier/shatag, SEE ALSO
shatag-add(1), shatag-mkdb(1) Shatag 0.1 26.08.2010 shatag(1)
All times are GMT -4. The time now is 12:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy