Sponsored Content
Full Discussion: Last Accessed Time Script
Top Forums Shell Programming and Scripting Last Accessed Time Script Post 302420691 by digitaljunkie on Wednesday 12th of May 2010 09:28:33 AM
Old 05-12-2010
OK thanks so my script now looks like this...

Code:
#!/bin/bash
## File Access Report
## Only edit the next 3 lines.
#Days ago to search
DAYS="365"
#TLD path you want to search
DIR="/Volumes/Macintosh HD/Users/"
#Output filename
FILENAME="/Files_For_Archiving.txt"
#
find "${DIR}" -type f -atime +${DAYS}  -printf FORMAT %Ak > $FILENAME

I am trying to use the print command to output the results formatted with a timestamp to my Variable Filename.

This doesn't seem to work or at lest my understanding the argument -print in the find command man page is off track?

Also I understand that backup software may alter the access timestamp but unless I have some long script that compares the <atime> with <mtime> I am unsure what to do. It a policy for archival, what I want to do is compile a list of human readable files (with paths to the file) of files over Xdays old which will mean they get archived off to tape.

If anyone has a better solution I am all ears :-)

But in the mean time I think this script is almost doneż? apart from the print formatting to the output file.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

getting last accessed and modified time together

actually, i'm making an Intrusion Detection System for education purpose (for project) using Bourne shell. The problem I get in that is:- 1. My application should check if there's some modification or alteration in the directory. 2, For that thing, I need to have every attribute of file and... (1 Reply)
Discussion started by: raku05
1 Replies

2. Shell Programming and Scripting

how to know which login file is being accessed

when unix is logged in it access some login file depending on the shell like .cshrc , .login , .vimrc , .bashrc how can we know which is being access in a perticular unix flavor. (1 Reply)
Discussion started by: useless79
1 Replies

3. Shell Programming and Scripting

Can we get the list of users who accessed a file

Hi all, I will thankful if anybody helps me in finding out the users who accessed any of our files. Thanks in advance Chanakya (2 Replies)
Discussion started by: Chanakya.m
2 Replies

4. AIX

File Accessed Alarm ??

Hey, I want to ask a simple Question.... How would I be able to come to know that files/directoires in a Parent directory has been accessed (means contents of the file has been just viewed) by the user(s) in a group ? and mail the name(s) of those files/directories which has been accessed... (1 Reply)
Discussion started by: varungupta
1 Replies

5. Shell Programming and Scripting

File Accessed Alarm ??

Hey, I want to ask a simple Question.... How would I be able to come to know that files/directoires in a Parent directory has been accessed (means contents of the file has been just viewed) by the user(s) in a group ? and mail the name(s) of those files/directories which has been accessed... (16 Replies)
Discussion started by: varungupta
16 Replies

6. UNIX for Dummies Questions & Answers

Searching files by last accessed time

How can I search for files by last accessed time? I want to see files accessed in the last 24 hours, for example...or even less time, maybe in the last 3 hours? Thank you in advance, Trellot (4 Replies)
Discussion started by: Trellot
4 Replies

7. Shell Programming and Scripting

Shell script to convert epoch time to real time

Dear experts, I have an epoch time input file such as : - 1302451209564 1302483698948 1302485231072 1302490805383 1302519244700 1302492787481 1302505299145 1302506557022 1302532112140 1302501033105 1302511536485 1302512669550 I need the epoch time above to be converted into real... (4 Replies)
Discussion started by: aismann
4 Replies

8. Shell Programming and Scripting

Ftp script hangs for first time,but works every second time

Hi I have an ftp script which works fine when i execute through a test scheduler(UC4), but when i run it through the prod scheduler(UC4), it hungs indefinetely, when we cancel the job and re-run it it works perfectly fine. here is the code,, any idea why this is happening ???? ... (1 Reply)
Discussion started by: selvankj
1 Replies

9. UNIX for Advanced & Expert Users

Track the files accessed by a script.

How can i track all the files accessed by script. The script is supposed to bring up my application and this script is just the main script which inturn calls another scripts and executable. I need to know all the the files this main script calls and the files accessed by all the other scripts... (2 Replies)
Discussion started by: chacko193
2 Replies

10. UNIX for Dummies Questions & Answers

File shows in ls but cannot be accessed

I can do an ls -l CD* and see the following CDTEST userA RW RW R and I an logged on as userA. But if I do an ls -l the file does not appear. If I do a vi CDTEST it tries to create a new file named CDTEST. If I do a mv or rm I get the message no file of name CDTEST found. Any idea what is going on.... (3 Replies)
Discussion started by: LeeT
3 Replies
AUTOCONF(1)							   User Commands						       AUTOCONF(1)

NAME
autoconf - Generate configuration scripts SYNOPSIS
autoconf [OPTION]... [TEMPLATE-FILE] DESCRIPTION
Generate a configuration script from a TEMPLATE-FILE if given, or `configure.ac' if present, or else `configure.in'. Output is sent to the standard output if TEMPLATE-FILE is given, else into `configure'. Operation modes: -h, --help print this help, then exit -V, --version print version number, then exit -v, --verbose verbosely report processing -d, --debug don't remove temporary files -f, --force consider all files obsolete -o, --output=FILE save output in FILE (stdout is the default) -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax] Warning categories include: `cross' cross compilation issues `obsolete' obsolete constructs `syntax' dubious syntactic constructs `all' all the warnings `no-CATEGORY' turn off the warnings on CATEGORY `none' turn off all the warnings `error' warnings are error The environment variables `M4' and `WARNINGS' are honored. Library directories: -B, --prepend-include=DIR prepend directory DIR to search path -I, --include=DIR append directory DIR to search path Tracing: -t, --trace=MACRO[:FORMAT] report the list of calls to MACRO -i, --initialization also trace Autoconf's initialization process In tracing mode, no configuration script is created. FORMAT defaults to `$f:$l:$n:$%'; see `autom4te --help' for information about FORMAT. AUTHOR
Written by David J. MacKenzie and Akim Demaille. REPORTING BUGS
Report bugs to <bug-autoconf@gnu.org>. GNU Autoconf home page: <http://www.gnu.org/software/autoconf/>. General help using GNU software: <http://www.gnu.org/gethelp/>. COPYRIGHT
Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+/Autoconf: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO
autoconf(1), automake(1), autoreconf(1), autoupdate(1), autoheader(1), autoscan(1), config.guess(1), config.sub(1), ifnames(1), libtool(1). The full documentation for autoconf is maintained as a Texinfo manual. If the info and autoconf programs are properly installed at your site, the command info autoconf should give you access to the complete manual. GNU Autoconf 2.69 August 2017 AUTOCONF(1)
All times are GMT -4. The time now is 08:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy