automaticly update your linux wftpserver installation

Post here if you have some suggestions or you want to request a new feature.

automaticly update your linux wftpserver installation

Postby MountainVision » Wed Mar 16, 2011 7:31 am

just run this script on your server.
please note, edit the directory names for your use!


  • it checks if there are opened connections
  • stops the wftpserver service
  • backups your Data-directory
  • download and extract the new version
  • start the wftpserver service

Code: Select all
#!/bin/bash
#
# CHECK IF THERE ARE OPENED CONNECTIONS
########################################
if [ `ls -1a /opt/wftpserver/session/|wc -l` -gt 2 ];
then echo "There are opened Connections -> Update canceled";
else
# STOP THE FTP-SERVICE
#######################
/etc/init.d/wftpserver stop
#
#
# BACKUP YOUR SETTINGS
#######################
rm -rf /opt/wftpserver_update/Data_bak
mkdir /opt/wftpserver_update/Data_bak
cp -r /opt/wftpserver/Data/* /opt/wftpserver_update/Data_bak
tar czvf /opt/wftpserver_update/Backup_files/Data_Backup_upd_$(date +"%Y.%m.%d_%H%M").tar.gz /opt/wftpserver_update/Data_bak
rm -rf /opt/wftpserver_update/Data_bak
#
#
#
# DOWNLOAD AND EXTRACT THE NEWEST VERSION
##########################################
wget http://www.wftpserver.com/download/wftp ... bit.tar.gz -O /opt/wftpserver_update/new_version.tar.gz
tar -xzvf /opt/wftpserver_update/new_version.tar.gz -C /opt
rm -rf /opt/wftpserver_update/new_version.tar.gz
#
# START THE FTP-SERVICE
########################
/etc/init.d/wftpserver start
#
fi
MountainVision
 
posts 10
 
joined Wed Mar 03, 2010 3:09 pm
Location: Laax, Switzerland

Return to Suggestions & Wishlist

Who is online

Users browsing this forum: No registered users and 2 guests