1 |
tmp=/tmp/backuppc-svn/ |
tmp=/tmp/backuppc-svn/ |
2 |
|
target=/data/backuppc/ |
3 |
|
profile_opt= |
4 |
|
profile_file=profile |
5 |
|
db=backuppc |
6 |
|
|
7 |
all: |
all: |
8 |
@echo "make install to install BackupPC using sudo" |
@echo "make install to install BackupPC using sudo" |
10 |
test: stop reinstall start |
test: stop reinstall start |
11 |
|
|
12 |
reinstall: |
reinstall: |
13 |
sudo perl ./configure.pl --batch --config-path=/data/backuppc/data/conf/config.pl |
sudo perl ./configure.pl --batch --config-path=$(target)/data/conf/config.pl |
14 |
|
|
15 |
install: |
install: |
16 |
sudo perl ./configure.pl |
sudo perl ./configure.pl |
17 |
|
|
18 |
start: |
start: |
19 |
#sudo -u backuppc /data/backuppc/bin/BackupPC -d |
#sudo -u backuppc /data/backuppc/bin/BackupPC -d |
20 |
sudo /data/backuppc/etc/backuppc start |
sudo $(target)/etc/backuppc start |
21 |
|
|
22 |
stop: |
stop: |
23 |
#sudo -u backuppc killall BackupPC && sleep 1 || true |
#sudo -u backuppc killall BackupPC && sleep 1 || true |
24 |
sudo /data/backuppc/etc/backuppc stop |
sudo $(target)/etc/backuppc stop |
25 |
|
|
26 |
|
install-etc: |
27 |
|
test -d $(target)/etc || cp -r etc $(target) && chmod 755 $(target)/etc/backuppc |
28 |
|
|
29 |
|
update: |
30 |
|
sudo -u backuppc /data/backuppc/bin/BackupPC_updatedb |
31 |
|
|
32 |
asa: |
asa: |
33 |
rm -Rf $(tmp) |
rm -Rf $(tmp) |
34 |
svn export . $(tmp) |
svn export . $(tmp) |
35 |
rsync -rav $(tmp) 10.210.99.1:backuppc-svn/ |
rsync -rav $(tmp) 10.210.99.1:backuppc-svn/ |
36 |
rm -Rf $(tmp) |
rm -Rf $(tmp) |
37 |
|
|
38 |
|
profile: test |
39 |
|
test -e tmon.out || touch tmon.out |
40 |
|
sudo chown backuppc tmon.out |
41 |
|
dropdb $(db) || echo "skip drop db" |
42 |
|
createdb $(db) |
43 |
|
date > $(profile_file) |
44 |
|
echo "## NORMAL RUN" >> $(profile_file) |
45 |
|
sudo -u backuppc /data/backuppc/bin/BackupPC_updatedb -c $(profile_opt) | tee -a $(profile_file) |
46 |
|
echo "## DProf RUN" >> $(profile_file) |
47 |
|
sudo -u backuppc perl -d:DProf /data/backuppc/bin/BackupPC_updatedb -d $(profile_opt) |
48 |
|
dprofpp 2>&1 | tee -a $(profile_file) |
49 |
|
echo "## DBI_PROFILE RUN" >> $(profile_file) |
50 |
|
DBI_PROFILE=2 sudo -u backuppc /data/backuppc/bin/BackupPC_updatedb -d $(profile_opt) 2>&1 | tee -a $(profile_file) |
51 |
|
mv $(profile_file) profile.`perl -e 'my @p = glob("profile.[0-9]*"); print scalar @p + 1'` |
52 |
|
|