PDA

View Full Version : delete log file


cytex
03-04-2005, 04:47 PM
Hi is there any Scheduler event who can delete all the log files every 10/20min? What type of Scheduler command will i add in ioftpd.ini file for this option?


// Cytex

esmandil
03-04-2005, 06:45 PM
What do you mean by "log files"? I can think of several things that match this description.

There is no built-in solution. You need to use a script - I do not know if there is one available which does what you need.

mr_F_2
03-04-2005, 06:47 PM
in file ..\scripts\kill_log.bat:

cd ..\logs
del xferlog
del ioFTPD.log
del Error.log
del SysOp.log
del SystemError.log


in you ioFTPD.ini under
[Scheduler]
add line:
del_logs = 0,10,20,30,40,50 * * * ..\scripts\kill_log.bat

restart your site
wait and see the results

(PS: untested)

cytex
03-09-2005, 12:55 PM
that script didn't work :(

Mouton
03-09-2005, 01:44 PM
Why do you want to delete log files ?

cytex
04-01-2005, 04:28 PM
Security reason :) If there is any way to do it? Then tell med

Grendel
04-06-2005, 01:32 PM
I cannot recommand to completely delete the log-files.
Some scripts will not work properly, if some specific log-files are missing. Try to "reset to 0" instead.

for example... resetlogs.bat


@echo off
rem.>c:\ioFTPD\logs\xferlog
rem.>c:\ioFTPD\logs\ioFTPD.log
rem.>c:\ioFTPD\logs\Error.log
rem.>c:\ioFTPD\logs\SysOp.log
rem.>c:\ioFTPD\logs\SystemError.log


this will reset all the logs to 0byte files

cytex
04-06-2005, 03:23 PM
Ok will try it out and yes i want to clean the log files so reseting them is a better choice.

jannat
06-10-2005, 03:14 AM
this doesn't seem to work for me.

kill_log.bat:
@echo off
rem.>c:\programme\ioftpd2\logs\xferlog
rem.>c:\programme\ioftpd2\logs\ioFTPD.log

in ioftpd.ini
del_logs = 0 * * * c:\programme\ioftpd2\scripts\kill_log.bat

error.log:
06-10-2005 10:00:30 Scheduler event 'del_logs' returned error.

any idea ?

Phlegm
06-10-2005, 04:27 AM
Originally posted by Grendel

@echo off
rem.>c:\ioFTPD\logs\xferlog
rem.>c:\ioFTPD\logs\ioFTPD.log
rem.>c:\ioFTPD\logs\Error.log
rem.>c:\ioFTPD\logs\SysOp.log
rem.>c:\ioFTPD\logs\SystemError.log



not rem. but echo. I think, so it would turn out as

@echo off
echo.>c:\ioFTPD\logs\xferlog
echo.>c:\ioFTPD\logs\ioFTPD.log
echo.>c:\ioFTPD\logs\Error.log
echo.>c:\ioFTPD\logs\SysOp.log
echo.>c:\ioFTPD\logs\SystemError.log

jannat
06-10-2005, 07:06 AM
tried it with echo => same error message ?

btw. if I start the bat directly it works, so it must be the scheduler stting in ioftpd.ini

Grendel
07-20-2005, 03:47 AM
1)

When you start the batch manually or as a normal [FTP_Custom_Command]
the use of "REM.>" or "ECHO.>" is not relevant.
Both commands are working properly and can create a 0byte file.

2)

For unknown reason, something didn't work in scheduler-mode.
It tried batch with "echo !detach 0" too, but still the same problem.


Maybe Darkone can give us any answers and a leading hand here ?

zeroxia
07-26-2005, 08:36 AM
In the .ini file:
del_logs = 0 * * * c:\programme\ioftpd2\scripts\kill_log.bat

Is it necessary to precede the batch file with EXEC??

Grendel
07-26-2005, 11:31 AM
In the .ini file:
del_logs = 0 * * * c:\programme\ioftpd2\scripts\kill_log.bat

Is it necessary to precede the batch file with EXEC??

hehe, you're right...
better do it with EXEC INSIDE *lol* :D :rolleyes: