From Wiki-UX.info

Wiki-UX / File Systems / How to update access time of a whole filesystem
Jump to: navigation, search

How to update access time of a whole filesystem

Abstract

This article explains a methods to update the last access time of every file in a specific file system.

It may be necessary to change the last access time of the file in a file system to establish a baseline for further operations, like reports.

The UNIX standard find and touch can be use to acomplish the task. Additionally, backup tool can be use for the same purpose. While the find with touch method is probably the fastest because only the first inode of the file is update, using backup tools allows to verify that the files can be read at the same time that the access time is updated.

Contents


Update access time using find and touch commands

# find <filesystem> -exec touch {} \;

Update access time using tar command

# tar -clf - <filesystem> > /dev/null 2> /tmp/report

Update access time using HP-UX fbackup command

# fbackup -0vi <filesystem> -f - > /dev/null 2> /tmp/reports

For example:

# fbackup -0vi /var/tmp -f - > /dev/null 2> /tmp/reports
 
# cat /tmp/reports
fbackup(1004): session begins on Thu Nov 22 10:23:52 2007
fbackup(3024): writing volume 1 to the output file -
    1: / 16
    2: /var 16
    3: /var/tmp 16
    4: /var/tmp/A492A.11.0.22.depot 1900
    5: /var/tmp/aaa001514 1
    6: /var/tmp/baa001514 15
    7: /var/tmp/bgpd 1
    8: /var/tmp/caa001514 3
    9: /var/tmp/daa001514 1
   10: /var/tmp/eaa001514 15
   11: /var/tmp/envd.action2 1
   12: /var/tmp/envd.action5 1
   13: /var/tmp/faa001514 3
   14: /var/tmp/food 1
   15: /var/tmp/food.awk 1
   16: /var/tmp/gaa001514 1
   17: /var/tmp/haa001514 15
   18: /var/tmp/iaa001514 3
   19: /var/tmp/isisd 1
   20: /var/tmp/mypasswd 1
   21: /var/tmp/mypasswd.crypt 1
   22: /var/tmp/mypasswd.crypt1 1
   23: /var/tmp/ramd 1
   24: /var/tmp/ripngd 1
   25: /var/tmp/swagent.log 1
   26: /var/tmp/sysstat_em.fmt 0
   27: /var/tmp/xf86.log 1
   28: /var/tmp/xf86.log.save 1
fbackup(1005): run time: 1 seconds
fbackup(3055): total file blocks read for backup: 2019
fbackup(3056): total blocks written to output file -: 2166

Authors

This page was last modified on 22 July 2010, at 04:19. This page has been accessed 1,605 times.