Using, modifying and reporting on timestamps to track changes in a filesystem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Using, modifying and reporting on timestamps to track changes in a filesystem
# 8  
Old 05-19-2011
I guess this was the idea:
Code:
.... |xargs -I{} touch {} --no-create --date=11:11:11

This User Gave Thanks to vgersh99 For This Post:
# 9  
Old 05-19-2011
Sorry, that's still not working, if I replace the "touch" command with "ls" then you can see the "No such file or directory" errors as shown below.

Edging ever closer though!

Code:
user@machine:~/datecheck$ ll
total 172
drwxr-xr-x  2 user user  4096 2011-05-19 17:16 ./
drwx------ 42 user user 12288 2011-05-19 15:09 ../
-rw-r--r--  1 user user     0 2011-05-19 11:11 test1
-rw-r--r--  1 user user     0 2011-05-19 17:16 test12
-rw-r--r--  1 user user     0 2011-05-19 17:16 test 13
user@machine:~/datecheck$ find . -xdev -type f -printf '%T+ %p \n' | grep -v 11:11:11 | cut -c32- | xargs -I {} ls {} 
ls: cannot access ./test12 : No such file or directory
ls: cannot access ./test 13 : No such file or directory
user@machine:~/datecheck$ find . -xdev -type f -printf '%T+ %p \n' | grep -v 11:11:11 | cut -c32- | cat
./test12 
./test 13

---------- Post updated at 06:37 PM ---------- Previous update was at 05:23 PM ----------

Quote:
Code:
-printf '%T+ %p \n'

I think I've found the problem Smilie

It was a bug in my printf formatting the above should actually read:

Code:
-printf '%T+ %p\n'

Yes it was that pesky space between %p and \n which was causing the issues.

Testing continues!

Thanks for all the help so far everyone.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Write with a look for timestamps

hello i'm using SOX to generate a spectrogram from a wave file with the command : #sox file.wav -n spectrogram is there a way to create a spectrogram using the same command but reading file timestamps instead of the namefile.wav , since name is changing every 4 hours? (it's saved with... (2 Replies)
Discussion started by: Board27
2 Replies

2. Shell Programming and Scripting

[Solved] Modifying/Removing Timestamps from a filename

So given filenames of varying lengths, I was wondering how I would remove or modify appended timestamps of the current date DD-MM-YY. So say: test_DD-MM-YY.txt coolbeans_DD-MM-YY.pdf And what I expect the output to be: test.txt coolbeans.pdf Thanks :) (2 Replies)
Discussion started by: sodaboyz
2 Replies

3. Shell Programming and Scripting

Help with touch and timestamps

Hello fellow Unix geeks, I have been given a very urgent assignment in my office on writing a particular Shell script but I'm very much new to it.I would appreciate any help from you on solving this problem--which might seem very trivial to you. The Unix flavour is a Sun Solaris one..(not... (6 Replies)
Discussion started by: Digjoy83
6 Replies

4. AIX

Mount Filesystem in AIX Unable to read /etc/filesystem

Dear all, We are facing prolem when we are going to mount AIX filesystem, the system returned the following error 0506-307The AFopen call failed : A file or directory in the path name does not exist. But when we ls filesystems in the /etc/ directory it show -rw-r--r-- 0 root ... (2 Replies)
Discussion started by: m_raheelahmed
2 Replies

5. Solaris

Solaris Filesystem vs. Windows FileSystem

Hi guys! Could you tell me what's the difference of filesystem of Solaris to filesystem of Windows? I need to compare both. I have read some over the net but it's so much technical. Could you explain it in a more simpler term? I am new to Solaris. Hope you help me guys. Thanks! (4 Replies)
Discussion started by: arah
4 Replies

6. UNIX for Dummies Questions & Answers

hwo to find shared filesystem and local filesystem in AIX

Hi, I wanted to find out that in my database server which filesystems are shared storage and which filesystems are local. Like when I use df -k, it shows "filesystem" and "mounted on" but I want to know which one is shared and which one is local. Please tell me the commands which I can run... (2 Replies)
Discussion started by: kamranjalal
2 Replies

7. Solaris

Filesystem - error when extend the filesystem

Hi all, currently , my root filesystem already reach 90 ++% I already add more cylinder in the root partition as below Part Tag Flag Cylinders Size Blocks 0 root wm 67 - 5086 38.46GB (5020/0/0) 80646300 1 swap wu 1 - ... (11 Replies)
Discussion started by: SmartAntz
11 Replies

8. Shell Programming and Scripting

timestamps

Hello! I have the following problem. I read a file using perl, each line of this file has the fllowing format. 14/4/2008 8:42:03 πμ|10800|306973223399|4917622951117|1||1259|1|126|492|433||19774859454$ Th first field is the timestamp and the second field is the offset in seconds. How can... (1 Reply)
Discussion started by: chriss_58
1 Replies

9. UNIX for Dummies Questions & Answers

Possible to track FTP user last login? Last and Finger don't track them.

Like the topic says, does anyone know if it is possible to check to see when an FTP only user has logged in? Because the shell is /bin/false and they are only using FTP to access the system doing a "finger" or "last" it says they have never logged in. Is there a way to see when ftp users log in... (1 Reply)
Discussion started by: LordJezo
1 Replies

10. Solaris

Difference between two timestamps

I'm writting a script to find the difference between two timestamp. One field i get on delivery time of the file like 07:17 AM and other is my SLA time 06:30 AM I need to find the difference between these two time (time exceeded to meet SLA). Need some suggestions. (8 Replies)
Discussion started by: raman1605
8 Replies
Login or Register to Ask a Question