atime synchronization example

The following example shows how to use the atime attribute to trigger retention for the existing wind.jpg object after atime synchronization has been enabled for the namespace; the example uses the NFS protocol:

1.Optionally, check the current retention setting for the wind.jpg object:

cat /metadatamount/images/wind.jpg/retention.txt
0
Deletion Allowed

2.Optionally, check the current permissions for the wind.jpg object:

ls -l /datamount/images/wind.jpg
-r--r--r-- 1 root root 23221 Mar 19 09:45 /datamount/images/wind.jpg

Notice that the object has no write permissions.

3.Set the atime attribute for the wind.jpg object:

touch -a -t 201512310000 /datamount/images/wind.jpg

Note: To set the value of the atime attribute, you can use the Windows SetFileTime library call, the Unix utime library call, or the Unix touch command.

4.Optionally, verify step 4:

stat /datamount/images/wind.jpg
File: "/datamount/images/wind.jpg"
Size: 23221 Blocks: 112 IO Block: 32768 regular file
Device: 15h/21d Inode: 18 Links: 1
Access: (0444/-r--r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2015-12-31 00:00:00.000000000 -0500
Modify: 2012-03-19 09:45:18.000000000 -0400
Change: 2012-03-23 13:10:17.000000000 -0400

5.Add write permissions to the wind.jpg object:

chmod a+w /datamount/images/wind.jpg

6.Remove all write permissions from the wind.jpg object:

chmod a-w /datamount/images/wind.jpg

7.Optionally, verify that the retention setting has changed to match the atime value:

cat /metadatamount/images/wind.jpg/retention.txt
1451520000
2015-12-31T00:00:00-0500

Trademarks and Legal Disclaimer

© 2016 Hitachi Data Systems Corporation. All rights reserved.