Discussion:
Delete old files from a folder
(too old to reply)
BRIAN MANTLER
2006-01-23 19:15:48 UTC
Permalink
In Netware using perl, I would like to delete all of the files in a folder that are older than x number of days. I'm sure there must be a script out there that can do this, but can't seem to find anything. Can anyone point me to the way?

Thanks.

Brian Mantler
Guenter Knauf, DevNet SysOp 32
2006-01-24 01:39:18 UTC
Permalink
Hi Brian,
Post by BRIAN MANTLER
In Netware using perl, I would like to delete all of the files in a
folder that are older than x number of days. I'm sure there must be a
script out there that can do this, but can't seem to find anything. Can
anyone point me to the way?
http://www.gknw.at/nwperl/perlscripts/cleanup.txt

Guenter.
BRIAN MANTLER
2006-01-24 14:42:39 UTC
Permalink
Thank you very much. I was looking at gknw.de.

This script is just what I need. However, in my testing I notice that it fails if you specify 8 days or more.

Without really knowing anything I am assuming it is because $deltime=time-$days*86400; gets too big if $days=8

Thanks again

Brian Mantler
Hi Brian,
Post by BRIAN MANTLER
In Netware using perl, I would like to delete all of the files in a
folder that are older than x number of days. I'm sure there must be a
script out there that can do this, but can't seem to find anything. Can
anyone point me to the way?
http://www.gknw.at/nwperl/perlscripts/cleanup.txt

Guenter.
Guenter Knauf, DevNet SysOp 32
2006-01-24 19:37:58 UTC
Permalink
Hi Brian,
Post by BRIAN MANTLER
Thank you very much. I was looking at gknw.de.
yes, was correct at some, and will be soon again - just some redirectors are
missing....; I recently moved the .com site completely to .at.
Post by BRIAN MANTLER
This script is just what I need. However, in my testing I notice that
it fails if you specify 8 days or more.
Without really knowing anything I am assuming it is because
$deltime=time-$days*86400; gets too big if $days=8
hmmm, I will take a look at it; however I doubt that this is the reason:
$days*86400 gets subtracted from a even much bigger value, and even more
important is that the greater $days the smaller gets $deltime !

what OS are you on? version, SP, nwlibx? target on NSS oder TFS?

Guenter.
BRIAN MANTLER
2006-01-25 10:52:02 UTC
Permalink
I'm using NW 6.5 sp 4.
My target folder is on a NSS volume.
Libc tells me Aug 4, 2005, v 9.00.01

Thanks again your all of your help.

Brian Mantler
Hi Brian,
Post by BRIAN MANTLER
Thank you very much. I was looking at gknw.de.
yes, was correct at some, and will be soon again - just some redirectors are
missing....; I recently moved the .com site completely to .at.
Post by BRIAN MANTLER
This script is just what I need. However, in my testing I notice that
it fails if you specify 8 days or more.
Without really knowing anything I am assuming it is because
$deltime=time-$days*86400; gets too big if $days=8
hmmm, I will take a look at it; however I doubt that this is the reason:
$days*86400 gets subtracted from a even much bigger value, and even more
important is that the greater $days the smaller gets $deltime !

what OS are you on? version, SP, nwlibx? target on NSS oder TFS?

Guenter.
BRIAN MANTLER
2006-01-25 11:42:00 UTC
Permalink
Now I am not so sure if there is a problem. I went back this morning to see if I could figure it out and it worked for 8 days, 100 days, and 1000 days for me.

I can't think of what has changed. I used the exact same command at the console prompt ( I just up arrowed), and the server has not rebooted recently or anything.

I must have made a mistake somewhere, perhaps I was looking in the wrong folder for results?

Thanks again.



Brian Mantler
I'm using NW 6.5 sp 4.
My target folder is on a NSS volume.
Libc tells me Aug 4, 2005, v 9.00.01

Thanks again your all of your help.

Brian Mantler
Hi Brian,
Post by BRIAN MANTLER
Thank you very much. I was looking at gknw.de.
yes, was correct at some, and will be soon again - just some redirectors are
missing....; I recently moved the .com site completely to .at.
Post by BRIAN MANTLER
This script is just what I need. However, in my testing I notice that
it fails if you specify 8 days or more.
Without really knowing anything I am assuming it is because
$deltime=time-$days*86400; gets too big if $days=8
hmmm, I will take a look at it; however I doubt that this is the reason:
$days*86400 gets subtracted from a even much bigger value, and even more
important is that the greater $days the smaller gets $deltime !

what OS are you on? version, SP, nwlibx? target on NSS oder TFS?

Guenter.

Loading...