Original from http://www.redmine.org/projects/redmine/wiki/RedmineUpgrade
upgrade 1.3.2(Ubuntu) to 2.4.2(Gentoo)
copy distrib redmine to new server and unpack to new folder
do not copy old configs
copy files folder
copy plugins folder
adjust database.yml according to manual
dump db with no parameters
# mysqldump redmine_database --result-file=/root/redmine_database.sql
create new database:
mysql> CREATE DATABASE `redmine_new_db` CHARACTER SET utf8 COLLATE utf8_general_ci;
restore db with no parameters
# mysql redmine_new_db < /root/redmine_database.sql
cd to new redmine folder (/var/lib/redmine)
# rake generate_secret_token
# rake db:migrate RAILS_ENV=production
if got error :
== CreateChangesetParents: migrating =========================================
-- create_table(:changeset_parents, {:id=>false})
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
Mysql2::Error: Table 'changeset_parents' already exists: CREATE TABLE `changese'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
do
# mysql -e 'drop table `changeset_parents`' redmine2new
then migration ok
Проблема: В журнале постоянно сообщения вида:
Connection from UDP: [192.168.11.1]:11227->[192.168.11.64]:161
Received SNMP packet(s) from UDP: [192.168.11.1]:11227->[192.168.11.64]:161
Решение: Чтобы они не писались в /etc/rc.conf:
snmpd_flags="-a -LF 0-5 /var/log/snmpd.log"
Создаем такого содержания файл /usr/local/scripts/apcupsd-stats :
#!/usr/local/bin/perl -w # Copyright (C) 2009 Glen Pitt-Pladdy # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # # # See: http://www.pitt-pladdy.com/blog/_20100320-215243_0000_apcupsd_stats_on_Cacti_via_SNMP_/ # open AC, "/usr/local/sbin/apcaccess status localhost |" or die "FATAL: can't run \"/usr/local/sbin/apcaccess\": $!\n"; while ( defined ( $line = <AC> ) ) { chomp $line; if ( $line !~ /^(\w+)\s*:\s*([^\s]+)/ ) { next; } $field{$1} = $2; } close AC; print "$field{LINEV}\n"; print "$field{OUTPUTV}\n"; print "$field{LOTRANS}\n"; print "$field{HITRANS}\n"; print "$field{BATTV}\n"; print "$field{NOMBATTV}\n"; print "$field{BCHARGE}\n"; print "$field{TIMELEFT}\n"; print "$field{LOADPCT}\n"; print "$field{LINEFREQ}\n"; #print "$field{ITEMP}\n"; #print ''.($field{'NOMPOWER'}*$field{'LOADPCT'}/100)."\n"; #print "$field{NOMPOWER}\n"; #if ( $field{'STATUS'} eq 'ONLINE' ) { # print "100\n0\n"; #} else { # print "0\n100\n"; #}
Некоторые модели не показывают температуру, как, например 420, поӕтому строку с температурой комментируем :-)
#print "$field{ITEMP}\n";
Делаем скрипт исполняемым
Read more: Zabbix APC Smart UPS monitoring on FreeBSD with snmp
#!/bin/bash
version='3.4.7'
prefix='/usr'
#prefix='/usr/local/squid-'${version}
if [ ! -f squid-$version.tar.xz ] ; then
wget http://www.squid-cache.org/Versions/v3/3.4/squid-$version.tar.xz
fi
if [ ! -d squid-$version ]; then
tar xvf squid-$version.tar.xz
fi
cd squid-$version
./configure \
--prefix=${prefix} \
--localstatedir=/var \
--srcdir=. \
--sysconfdir=/etc/squid \
--with-default-user=proxy \
--with-logdir=/var/log/squid \
--with-pidfile=/var/run/squid.pid \
--libexecdir=${prefix}/lib/squid \
--datadir=${prefix}/share/squid
make -j 30
make install
chown proxy /var/log/squid