Here's the scripts you'll need you can use a cron job to schedule them. I have attached a cleanup which will delete the logfiles a day after they have been switch(ie. you would have todays and yesterdays logfiles, but any prior would be deleted. Make sure the ftp process is working before you schedule the cleanup.
![[cheers] [cheers] [cheers]](/data/assets/smilies/cheers.gif)
logwitch
#! /bin/csh
#
# This file was created by Access 2 Networks.
# The purpose of the file is to run the fw logswitch command.
#
# The next line reads in environment variables for this session.
#
source /var/etc/pm_cshrc
#
setenv NAME `uname -n`
setenv DATE `date +%d%b%Y-%H%M`
# The next line runs the command.
#
fw logswitch $NAME-$DATE
-----------------------------------------------------------fwlog-ftp
#! /bin/csh
#
# This file was created by Access 2 Networks.
# The purpose of the file is to ftp log files to an FTP server.
#
# The next line reads in environment variables for this session.
#
source /var/etc/pm_cshrc
#
# The next line sets the environment variable for NAME and FWLOG.
#
setenv NAME `uname -n`
setenv FWLOG `date +%d%b%Y-%H`
#
# The next line changes directories.
#
cd /opt/CPfw1-50-03/log
#
# The next line zips up the files and then deletes the original log files.
#
#tar -cvzf /opt/CPfw1-50-03/log`uname -n`-`date +%d%b%Y-%H%M`-fwlog.tgz $NAME-$F
WLOG* |xargs rm -rf
#
# The next section opens an ftp session and puts the files onto the ftp server.
# It uses the .netrc file for the username and password for the ftp setting.
#
cd /opt/CPfw1-50-03/log
ftp -i <ip of ftp server> << HERE
binary
mput $NAME*
lcd /var/admin
put $NAME*
close
quit
HERE
-----------------------------------------------------------
cleanup
#! /bin/csh
#
# This file was created by Access 2 Networks.
# The purpose of the file is to delete files that are old.
#
# The next line reads in environment variables for this session.
#
source /var/etc/pm_cshrc
setenv NAME `uname -n`
#
# The next line finds files in the /var/backup directory and
# deletes any files that are more than 5 days old.
# This is defined by the number after the +.
#
find /opt/CPfw1-50-03/log/$NAME* -ctime +1 -exec rm {} \;
-----------------------------------------------------------.netrc
machine <ipaddress> login <ftpuserid> password <password>