What I want to achieve is to get the last “access time” for all the files on the shares with stat or find.
Unfortunately the access time is always equal to the c(hange)time and m(odification)time. When I look at the file with smbclient I can see the correct last ”access time”, also when I mount the Netapp share by nfs the access time is shown correct. The same behavior is seen with WSL (which uses Ubuntu).
Example from CentOS cifs:
Code: Select all
root@localhost cifs_path# stat L_Test-1.txt
File: L_Test-1.txt
Size: 51 Blocks: 1 IO Block: 1048576 regular file
Device: 60h/96d Inode: 17789497791182050313 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2021-02-24 10:23:58.239296000 +0100
Modify: 2021-02-24 10:23:58.239296000 +0100
Change: 2021-02-24 10:23:58.239296000 +0100
Birth: -
Code: Select all
root@localhost nfs_path# stat L_Test-1.txt
File: L_Test-1.txt
Size: 51 Blocks: 0 IO Block: 65536 regular file
Device: 61h/97d Inode: 37897 Links: 1
Access: (0777/-rwxrwxrwx) Uid: ( 0/ root) Gid: ( 2/ daemon)
Access: 2021-02-25 18:34:13.918625000 +0100
Modify: 2021-02-24 10:23:58.239296000 +0100
Change: 2021-02-24 10:23:58.239296000 +0100
Birth: -
Code: Select all
smbclient //1.2.3.4/test_vol
Try "help" to get a list of possible commands.
smb: \> allinfo L_Test-1.txt
NT_STATUS_NOT_SUPPORTED getting alt name for \L_Test-1.txt
altname:
create_time: Tue Feb 23 11:56:45 AM 2021 CET
access_time: Thu Feb 25 06:34:14 PM 2021 CET
write_time: Wed Feb 24 10:23:58 AM 2021 CET
change_time: Wed Feb 24 10:23:58 AM 2021 CET
attributes: A (20)
stream: [::$DATA], 51 bytes
The output of /proc/mounts:
//1.2.3.4/test_vol on /mnt/cifs_path type cifs (rw,relatime,vers=3.1.1,cache=strict,username=test,domain=test,uid=0,noforceuid,gid=0,noforcegid,addr=1.2.3.4,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=65536,wsize=65536,bsize=1048576,echo_interval=60,actimeo=1,user=test)
Installed cifs Version:
cifs-utils-6.8-3.el8.x86_64
Installed Samba Versions:
samba-4.11.2-13.el8.x86_64
samba-common-tools-4.11.2-13.el8.x86_64
pcp-pmda-samba-5.0.2-5.el8.x86_64
samba-client-4.11.2-13.el8.x86_64
samba-client-libs-4.11.2-13.el8.x86_64
samba-libs-4.11.2-13.el8.x86_64
samba-common-4.11.2-13.el8.noarch
samba-common-libs-4.11.2-13.el8.x86_64
CentOS Linux release 8.2.2004 (Core) Kernel 4.18.0-193.6.3.el8_2.x86_64
Does anybody has a hint how to get the proper access time when mounting the share via cifs?
Thanks in advance