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:
Procedure
(Optional) Check the current retention setting for the wind.jpg object:
cat /metadatamount/images/wind.jpg/retention.txt 0 Deletion Allowed
(Optional) 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.
Set the
atime
attribute for the wind.jpg object:touch -a -t 201512310000 /datamount/images/wind.jpg
NoteTo set the value of theatime
attribute, you can use the Windows SetFileTime library call, the Unix utime library call, or the Unix touch command.(Optional) Verify step 3:
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
Add write permissions to the wind.jpg object:
chmod a+w /datamount/images/wind.jpg
Remove all write permissions from the wind.jpg object:
chmod a-w /datamount/images/wind.jpg
(Optional) 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