Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changing the time/date stamp through FTP

188 views
Skip to first unread message

kaari

unread,
Sep 1, 2010, 5:12:58 AM9/1/10
to
Hi all,

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

Aragorn

unread,
Sep 1, 2010, 6:26:01 AM9/1/10
to
On Wednesday 01 September 2010 11:12 in comp.os.linux.setup, somebody
identifying as kaari wrote...

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)

kaari

unread,
Sep 1, 2010, 8:03:25 AM9/1/10
to

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"

unruh

unread,
Sep 1, 2010, 9:27:09 AM9/1/10
to
On 2010-09-01, kaari <amila...@gmail.com> wrote:

> On Sep 1, 3:26?pm, Aragorn <arag...@chatfactory.invalid> wrote:
>> On Wednesday 01 September 2010 11:12 in comp.os.linux.setup, somebody
>>
>>
>>
>> identifying as kaari wrote...
>> > Hi all,
>>
>> > 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.
>

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.

AJ

unread,
Sep 1, 2010, 11:47:04 PM9/1/10
to
On Sep 1, 11:27 pm, unruh <un...@wormhole.physics.ubc.ca> wrote:

Try to use SFTP

AJ

unread,
Sep 2, 2010, 12:03:25 AM9/2/10
to
rename oldpath newpath
Rename remote file from oldpath to newpath.
**man sftp

kaari

unread,
Sep 2, 2010, 12:25:03 AM9/2/10
to
On Sep 1, 6:27 pm, unruh <un...@wormhole.physics.ubc.ca> wrote:

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.

kaari

unread,
Sep 2, 2010, 8:14:47 AM9/2/10
to
On Sep 1, 6:27 pm, unruh <un...@wormhole.physics.ubc.ca> wrote:

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

Nico Kadel-Garcia

unread,
Sep 3, 2010, 9:04:06 AM9/3/10
to

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?

0 new messages