Sponsored Content
Top Forums UNIX for Dummies Questions & Answers -atime not working as expected Post 302560001 by canon273 on Wednesday 28th of September 2011 03:34:50 PM
Old 09-28-2011
-atime not working as expected

I need to sort through a volume that contains video files by access time and delete files that have not been accessed over x days. I have to use the access time as video files are originals that do not get modified, just read

Testing commands on a local test folder...
Code:
$ date
Wed Sep 28 12:46:05 MDT 2011
$ cd ~/Desktop/unixtests01/
$ ls -l
total 32
-rw-r--r--  1 shoei  shoei  1788 Aug 31 09:46 newlist.txt
-rw-r--r--  1 shoei  shoei     6 Aug 31 09:31 simpletext.txt
-rw-r--r--  1 shoei  shoei    11 Aug 31 09:32 simpletext2.txt
-rw-r--r--@ 1 shoei  shoei  24 Sep 13 16:43 /Users/shoei/Desktop/unixtests01//simpletext3.txt
$ find . -type f -atime -20 -exec ls -ltr {} \;
-rw-r--r--  1 shoei  shoei  1788 Aug 31 09:46 /Users/shoei/Desktop/unixtests01//newlist.txt
-rw-r--r--  1 shoei  shoei  6 Aug 31 09:31 /Users/shoei/Desktop/unixtests01//simpletext.txt
-rw-r--r--  1 shoei  shoei  11 Aug 31 09:32 /Users/shoei/Desktop/unixtests01//simpletext2.txt
-rw-r--r--@ 1 shoei  shoei  24 Sep 13 16:43 /Users/shoei/Desktop/unixtests01//simpletext3.txt
$ find . -type f -atime +20 -exec ls -ltr {} \;
$

it would seem that simpletext3 would be in the -20 category, while the others would be in the +20. ???

Running in bash on OS X 10.6.8
Smilie

Moderator's Comments:
Mod Comment Video tutorial on how to use code tags in The UNIX and Linux Forums.

Last edited by radoulov; 09-28-2011 at 06:14 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

which not working as expected

Hello. Consider the following magic words: # ls `which adduser` ls: /usr/sbin/adduser: No such file or directory # Hmmm... Then: # ls /usr/sbin/adduser /usr/sbin/adduser # Now what? Unforunately this little sniippet is used in my debian woody server's mysql pre install script.... (2 Replies)
Discussion started by: osee
2 Replies

2. Shell Programming and Scripting

ls not working as expected within ksh

Hi, I use the command ls a\b\c\*.txt from the command line on HP UNIX and it works fine - It lists all files matching *.txt in the a\b\c directory When embeded in a ksh script `ls a\b\c\*.txt` it does not work - I get *.txt not found (even though there are files) I tried... (10 Replies)
Discussion started by: GNMIKE
10 Replies

3. UNIX for Dummies Questions & Answers

Redirection not working as expected

Portion of my script below : if ; then NUMBEROFFEILDS=`cat ${BASE_SCRIPT_LOC}/standardfilecleanup.lst|grep -w ${db_file_path}|awk -F: '{print NF}'` COUNT=4 while ; do awk_var="$"`echo $COUNT` file_name1=`cat ${BASE_SCRIPT_LOC}/standardfilecleanup.lst|grep -w... (1 Reply)
Discussion started by: findprakash
1 Replies

4. Red Hat

FTP on Linux is not working as expected

Hi, I need to write a Linux shell script which will perform an FTP operation to another server. main.sh will contain - ftp -nd Dest.IP.address < ftpScript.sh Contents of ftpScript.sh is given below - user userid passwd prompt lcd /vidya/Input cd vidya/Output mput *.* close ... (1 Reply)
Discussion started by: vidyak
1 Replies

5. Shell Programming and Scripting

Why this is not working in expected way?

total=0 seq 1 5 | while read i ; do total=$(($total+$i)) echo $total done echo $totalThis outputs: 1 3 6 10 15 0whereas I am expecting: 1 3 6 10 15 15My bash version: (4 Replies)
Discussion started by: meharo
4 Replies

6. Shell Programming and Scripting

echo is not working as expected

for i in `cat /export/home/afahmed/Arrvial_time.txt` do echo $i echo $i | awk '$3 < $D { print $4 }' >> dynamic_DF.txt; done When i echo, its echo as Nov 15 02:24 /export/home/pp_adm/inbound//wwallet_20111115.txt where i expect it to be Nov 15 02:24... (7 Replies)
Discussion started by: afahmed
7 Replies

7. UNIX for Dummies Questions & Answers

Nohup not working as expected

Hi. I am trying to start a script on my router that will execute even if i log off. To execute the script I write: nohup ./dslconnection > dslstat.out 2>&1 & It starts the job: 21968 admin 1604 S /bin/ash ./dslconnection The problem is that when I log back in the job has been... (6 Replies)
Discussion started by: sebcou
6 Replies

8. Shell Programming and Scripting

Script not working as expected

Hi, I have prepared a script and trying to execute it but not getting expected output. Could you please help and advise what is going wrong. "If else" part in below script is not working basically. I am running it on HP-UX. for i in slpd puma sfmdb do echo "******\t$i\t*******" echo... (10 Replies)
Discussion started by: sv0081493
10 Replies

9. UNIX for Advanced & Expert Users

Test -e not working as expected (by me)

I ran into the following and still do not understand entirely the rationale behind this. If someone could explain why things are as they are I'd be thankful. The following was tested on AIX 7.1 with ksh88, but i suspect that to be ubiquitous. In an installation routine i had to create a set of... (6 Replies)
Discussion started by: bakunin
6 Replies

10. Shell Programming and Scripting

awk gsub not working as expected

Hi Experts, Need your kind help with gsub awk. Below is my pattern:"exec=1_host_cnt=100_dup=4_NameTag=targetSrv_500.csv","'20171122112948"," 100"," 1"," 1"," 4","400","","", " aac sample exec ""hostname=XXXXX commandline='timeout 10 openssl speed -multi 2 ; exit 0'"" ","-1","-1","1","... (6 Replies)
Discussion started by: pradyumnajpn10
6 Replies
OGGCUT(1)							   User Manuals 							 OGGCUT(1)

NAME
oggCut - extracts parts of an ogg file (.ogv, .ogg and .oga) SYNOPSIS
oggCut [options] inputfile outputfile DESCRIPTION
oggCut creates a new ogg file named outputfile as a subpart of the original file named inputfile oggCut is able to cut video (theora) only files, audio (vorbis) only files or files with both video and audio streams. The start and end time for the cut area must be given in milliseconds with the options -s and -e. As a video stream consists of I-frames (which are full pictures) and P-frames (which are delta pictures to the leading I-frame) the oggCut algorithm searches for the first I-frame. If a video file would start with a p-frame, the player is not able to interpret this picture, as the leading I-frame (on where it is based) is not available. oggCut starts the I-frame search at the start time given by the -s option. So expect a shorter video time than the calculated seconds for the new file. oggCut does not do any reencoding, therefore the output quality is completely the same as from the input file. For those involved into the ogg container format: The file is cut on packet basis, not on page basis. There is another tool called oggCut out in the internet with a different synopis. This one has not been written by the author of this tool you are actually using. OPTIONS
-s Cut start position in ms. If the input file is a video file, the cut area starts with the next keyframe found. Default: 0 Example: -s 5000 -l Length of the cut area in ms. If -e is also given, the length is ignored. Example: -l 10000 -e Cut end position in ms. If -l is also used, the end position is prefered. If the end position is set to -1, the end of the stream is assumed. Default: -1 Example: -e 20000 EXAMPLE
oggCut -s 1000 -e 21000 myVideo.ogv myOutput.ogv Creates a new video called myOutput.ogv from the video myVideo.ogv starting after 1 second ending after 21 seconds AUTHOR
Joern Seger <yorn at gmx dot net> SEE ALSO
oggCat(1), oggJoin(1), oggSplit(1), oggTranscode(1), oggSlideshow(1), oggThumb(1), oggSilence(1) Linux JAN 2010 OGGCUT(1)
All times are GMT -4. The time now is 10:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy