Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
ikafka
Collaborator
Jump to solution

How to send log files to FTP

Hello;

At the beginning of each new day I want to send the log files of the previous day to the FTP server.
As you know, as the log files in SMS increase, old logs are deleted. Sometimes it is difficult to retrieve logs with WinSCP. So I want to get logs to my Windows FTP server at the beginning of each new day.

Info:

log file path: /var/log/opt/CPsuite-R81.10/fw1/log

ftp server: Windows

 

Thanks CM.

1 Solution

Accepted Solutions
HeikoAnkenbrand
Champion Champion
Champion

 

Use this script - you need to modify it a little - and start it via a cronjob.

 

#!/bin/bash
FTPSERVER="1.2.3.4";
FTPPW="password";
FTPUSER="username";

echo "
verbose
user \$FTPUSER \$FTPPW
bin
lcd  /var/log/opt/CPsuite-R81.10/fw1/log
put "<name of the logfile>"
bye
" | /usr/bin/ftp -in \$FTPSERVER > /tmp/test 2>&1;

 

 

➜ CCSM Elite, CCME, CCTE

View solution in original post

(1)
2 Replies
HeikoAnkenbrand
Champion Champion
Champion

 

Use this script - you need to modify it a little - and start it via a cronjob.

 

#!/bin/bash
FTPSERVER="1.2.3.4";
FTPPW="password";
FTPUSER="username";

echo "
verbose
user \$FTPUSER \$FTPPW
bin
lcd  /var/log/opt/CPsuite-R81.10/fw1/log
put "<name of the logfile>"
bye
" | /usr/bin/ftp -in \$FTPSERVER > /tmp/test 2>&1;

 

 

➜ CCSM Elite, CCME, CCTE
(1)
ikafka
Collaborator

Hello HeikoAnkenbrand

Thank you for the script I sent. I edited the script I wrote earlier and it worked. He's doing my job now. As you said, the script you sent needs to be edited!

Regards.

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    Thu 25 Apr 2024 @ 11:00 AM (SGT)

    APAC: CPX 2024 Recap

    Tue 30 Apr 2024 @ 03:00 PM (CDT)

    EMEA: CPX 2024 Recap

    Wed 01 May 2024 @ 02:00 PM (EDT)

    South US: HTTPS Inspection Best Practices

    Thu 02 May 2024 @ 11:00 AM (SGT)

    APAC: What's new in R82

    Thu 25 Apr 2024 @ 11:00 AM (SGT)

    APAC: CPX 2024 Recap

    Tue 30 Apr 2024 @ 03:00 PM (CDT)

    EMEA: CPX 2024 Recap

    Wed 01 May 2024 @ 02:00 PM (EDT)

    South US: HTTPS Inspection Best Practices

    Thu 02 May 2024 @ 11:00 AM (SGT)

    APAC: What's new in R82
    CheckMates Events