-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sftp: Add new quote commands 'atime' and 'mtime' #5810
Conversation
return; | ||
} | ||
sshc->quote_attrs->flags |= SSH_FILEXFER_ACMODTIME; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two else if statements look very similar.
Why not try to put them into one and obfuscate the code a bit :-)
Thanks! |
@COFFEETALES @bagder I've been trying for 2 days now to get this working with curl version Server:
Client:
Am I missing something? Are there server-side requirements? Verbose output doesn't provide any additional insights. Looking through the server logs didn't show any clear causes. Or sshd is logging the error to some log unknown to me. |
$ curl -Q "mtime $now data/bar" -u sftp:pass sftp://server.my.corp:22/data/
The parser expects a single argument for the date, so you need to either use a
format without spaces (e.g. $(date +%s)) or quote it.
|
@dfandrich thanks for the reply. Are you actually getting successful results with that?
I should clarify that both the client and server are both Fedora 37 machines. |
It looks like the +%s format isn't actually supported, but this works fine:
$ curl -Q "mtime \"$(date -R)\" /tmp/foo" sftp://server/tmp/foo
|
Wow. That's a very specific syntax. I wouldn't have thought of explicitly using escaped double-quotes. |
In some situations, you may have to change the modified or last accessed date of a specific file.
This PR add new quote commands for sftp only.