I have a ftp server called UPDATE where as it contains all the update
files (content and image) of a web server. Updates are upload once two
days.I have ftp and ssh connections to this FTP server from my
location.
What i need to do is, through ftp,
I want to change the update fils's time / date stamp.
e.g if there is a update file named
imageupdate-20100830.tar.gz with the time stamp of 2010 08 30 7.30 a.m
i need to change the time stamp of that file to today (i.e 2010 09 01
x.xx a.m).
If i can do it remotely for update files that would achieve my target.
Can anyone give me a assistance on this..
Please, Many thanks in advance
I don't know of any FTP implementation that would allow this without
overwriting/modifying the target file, but you /can/ do it via SSH, of
course, and you did say that you have an SSH connection to the machine.
man touch
... will tell you how to update or change a file's timestamps. ;-)
--
*Aragorn*
(registered GNU/Linux user #223157)
Hi Aragorn,
I already tried touch -t YYYYMMDD filename and
MDTM too but no luck since
FTP> help
not listing "touch" and "mdtm" as possible commands in ftp.
i've used following bash to do it with no luck. So i'm looking any
more options of doing this.
#!/bin/bash
ftp -inv <<EOF
open 192.168.0.19
user username passwd
cd 20100901-test
bin
mdtm 20100901170000 imageupdate-20100901.tar.gz # or touch -t
xxxxxxx filename
EOF
If any one can help me with this. Basically I need a way to set
timestamp of a file without using "touch"
No. You said you had ssh intot hat system as well. Use ssh and touch,
not ftp.
But first tell us why youwnat to do this.
The maintainer of the server has a script which deletes all the update
files which are older than2 weeks. but some of them are still needed
even after 2weeks. So i'm lookning for a way to do what i've trying to
do in the first place.
For AJ,
Thanks, they are using VSFTP.
Still no luck.
Hi
I was mistaken, My 192.168.0.19 was the server that i was testing
this. and it is a local linux box (centos). But the update ftp server
is somewhere else. and only having the ftp connection. So no option
but to try everything with FTP. Otherwise through ssh it could achieve
very easily.
Any help is appreciated greatly
Thanks
Perhaps you could investigate rsync, which is considerably more
efficient than an FTP trasfer, works over SSH well, and allows
considerable local control of the file you want to send before you
send it?