My question is simple but I was not able to find an answer in the internet, and that's why I am here!
My question is: when I sftp to a server and use "put -P" option to put a file, it keeps the file's full permission and access time. Check below what sftp's man page says about it: "If the -P flag is specified, then the file's full permission and access time are copied too."
What I need is to overwrite the "-P" option in the server side, I mean, I need to change the access time to the current time, is like the client not used the "-P" option.
Is there a way to do it?
Below there is an example(of course you know it):
As you saw, it kept the access time when I used the -P option, and changed the access time when I did not use it.
Again, what I need is whenever the client uses the -P option, the server ignores it and changes the access time.
Afaik there is no option for the sshd (sshd_config) on the receiving side to ignore -P from a client's put.
Try to make sure the clients don't use that -P option.
An awkward procedure might be to set up a little script in crontab that stats a file a client has transfered with -P, parse the change time and touch the file with it:
---------- Post updated at 02:43 PM ---------- Previous update was at 02:34 PM ----------
Parsing the date for the touch command could look like this:
Last edited by zaxxon; 03-29-2010 at 09:44 AM..
Reason: update, more help
Hi Folks,
I am trying to copy a directory along with sub-directories to SFTP server.
I have connected to SFTP and tried to run the below command:
sftp> get -r abc/*
It is throwing the error Invalid flag -r
Can you please let me know the ways to copy a directory from Local to SFTP
... (1 Reply)
Hi,
I have sftp installed in some of my corporate servers (test and production).
However, I notice that it does not have the limit(l) option for bandwidth limit option.
Why is this? Is it because sftp was not installed with other necessary packages?
How do I make sftp available with the... (4 Replies)
I have a .ksh script that creates an sftp batch file and runs it through sftp. It works except for one thing. If I try to "put" to a different name, it doesn't use the specified remote name...it still "puts" the original local name.
I've tried both of these, and neither work...it will always... (4 Replies)
Hi,
I am getting the below error while doing sftp in a script file but the same is getting executed when i run from command prompt
./CARE_SM2_SFTP.sh: put: not found
Code :-
sftp ${USER_ID}@${FTPHOST4}:/opt/path
put <Filename with path>
chmod 777 <FileName with Path>... (2 Replies)
hi,
i am using sftp to transfer files between two servers,
if i connect to a remote server using sftp n moves a file say "S123.txt" to the remote server, it moves successfully, but when i try to execute the same sftp script to move the same files to the same remote server, the old file is... (3 Replies)
Hi,
ServerA (SFTP server)
ServerB (SFTP client)
ServerB:> sftp user@ServerA
ServerB:> put sample.txt
ServerB:> get sample2.txt
My question is that which machine will encrypt the sample.txt and sample2.txt files.
Thanks (8 Replies)
Helo I have already installed manbase - 4.0.0.0.15
Now I m installing newver version of the same rpm using
rpm -iv -replacefiles manbase -4.0.0.0.16
But using this option my important config files is overwrite.
now I want that using
first check whethere config file is there or not.... (0 Replies)
Hi guys,
I'm having a problem with F-Secure Unix.
When I try a simple command;
sftp> put local.test remote.test
I expect that the local file local.test would be copied to the remote file remote.test
However sftp is attempting to copy local.test & remote.test from the local machine, as if... (2 Replies)