Setting the creation time of a file on a CIFS share
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I'm trying to replace an old Windows laptop I've been using as a "sneakernetting station" to copy files from NTFS-formatted hard drives to a Samba share using the WIndows robocopy
utility. rsync
is a more-than-capable replacement for robocopy
, with one exception: it can't set creation timestamps, because historically Linux filesystems haven't supported them. CIFS shares certainly do, though, so I'm looking for a way to set the creation timestamps to fix them up after copying the files. (I already know how to get the creation time from NTFS.)
There are a few different questions here and on Super User about Linux creation times generally (1, 2, 3, 4, 5, 6), whose answers boil down to "Linux doesn't creation time". But I only need to set times for files on CIFS shares, and I'm willing to use filesystem-specific interfaces or a userspace program that talks directly to the server.
The statx
system call reports the creation time (birth time) if available and requested, and the cifs filesystem does support this. However, as of February 2018, there is no Linux system call that allows setting the creation time.
The cifs filesystem also exposes creation time as the extended attribute user.cifs.creationtime
, but this attribute is read-only because it is only checked for in cifs_xattr_get
, not in cifs_xattr_set
.
I can also access the share with the FTP-style smbclient
program, and its allinfo
command prints the creation time, but based on the man page and the command listing printed by the help
command, there is no command to set any file timestamps.
How can I set the creation time of a file on a CIFS share?
(If it's currently not possible, there's no need to leave an answer saying so. Just leave the question unanswered.)
timestamps cifs
add a comment |Â
up vote
0
down vote
favorite
I'm trying to replace an old Windows laptop I've been using as a "sneakernetting station" to copy files from NTFS-formatted hard drives to a Samba share using the WIndows robocopy
utility. rsync
is a more-than-capable replacement for robocopy
, with one exception: it can't set creation timestamps, because historically Linux filesystems haven't supported them. CIFS shares certainly do, though, so I'm looking for a way to set the creation timestamps to fix them up after copying the files. (I already know how to get the creation time from NTFS.)
There are a few different questions here and on Super User about Linux creation times generally (1, 2, 3, 4, 5, 6), whose answers boil down to "Linux doesn't creation time". But I only need to set times for files on CIFS shares, and I'm willing to use filesystem-specific interfaces or a userspace program that talks directly to the server.
The statx
system call reports the creation time (birth time) if available and requested, and the cifs filesystem does support this. However, as of February 2018, there is no Linux system call that allows setting the creation time.
The cifs filesystem also exposes creation time as the extended attribute user.cifs.creationtime
, but this attribute is read-only because it is only checked for in cifs_xattr_get
, not in cifs_xattr_set
.
I can also access the share with the FTP-style smbclient
program, and its allinfo
command prints the creation time, but based on the man page and the command listing printed by the help
command, there is no command to set any file timestamps.
How can I set the creation time of a file on a CIFS share?
(If it's currently not possible, there's no need to leave an answer saying so. Just leave the question unanswered.)
timestamps cifs
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm trying to replace an old Windows laptop I've been using as a "sneakernetting station" to copy files from NTFS-formatted hard drives to a Samba share using the WIndows robocopy
utility. rsync
is a more-than-capable replacement for robocopy
, with one exception: it can't set creation timestamps, because historically Linux filesystems haven't supported them. CIFS shares certainly do, though, so I'm looking for a way to set the creation timestamps to fix them up after copying the files. (I already know how to get the creation time from NTFS.)
There are a few different questions here and on Super User about Linux creation times generally (1, 2, 3, 4, 5, 6), whose answers boil down to "Linux doesn't creation time". But I only need to set times for files on CIFS shares, and I'm willing to use filesystem-specific interfaces or a userspace program that talks directly to the server.
The statx
system call reports the creation time (birth time) if available and requested, and the cifs filesystem does support this. However, as of February 2018, there is no Linux system call that allows setting the creation time.
The cifs filesystem also exposes creation time as the extended attribute user.cifs.creationtime
, but this attribute is read-only because it is only checked for in cifs_xattr_get
, not in cifs_xattr_set
.
I can also access the share with the FTP-style smbclient
program, and its allinfo
command prints the creation time, but based on the man page and the command listing printed by the help
command, there is no command to set any file timestamps.
How can I set the creation time of a file on a CIFS share?
(If it's currently not possible, there's no need to leave an answer saying so. Just leave the question unanswered.)
timestamps cifs
I'm trying to replace an old Windows laptop I've been using as a "sneakernetting station" to copy files from NTFS-formatted hard drives to a Samba share using the WIndows robocopy
utility. rsync
is a more-than-capable replacement for robocopy
, with one exception: it can't set creation timestamps, because historically Linux filesystems haven't supported them. CIFS shares certainly do, though, so I'm looking for a way to set the creation timestamps to fix them up after copying the files. (I already know how to get the creation time from NTFS.)
There are a few different questions here and on Super User about Linux creation times generally (1, 2, 3, 4, 5, 6), whose answers boil down to "Linux doesn't creation time". But I only need to set times for files on CIFS shares, and I'm willing to use filesystem-specific interfaces or a userspace program that talks directly to the server.
The statx
system call reports the creation time (birth time) if available and requested, and the cifs filesystem does support this. However, as of February 2018, there is no Linux system call that allows setting the creation time.
The cifs filesystem also exposes creation time as the extended attribute user.cifs.creationtime
, but this attribute is read-only because it is only checked for in cifs_xattr_get
, not in cifs_xattr_set
.
I can also access the share with the FTP-style smbclient
program, and its allinfo
command prints the creation time, but based on the man page and the command listing printed by the help
command, there is no command to set any file timestamps.
How can I set the creation time of a file on a CIFS share?
(If it's currently not possible, there's no need to leave an answer saying so. Just leave the question unanswered.)
timestamps cifs
asked Feb 26 at 3:25
Jeffrey Bosboom
2581412
2581412
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f426592%2fsetting-the-creation-time-of-a-file-on-a-cifs-share%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password