1 |
tmp=/tmp/backuppc-svn/ |
tmp=/tmp/backuppc-svn/ |
2 |
target=/data/backuppc/ |
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" |
24 |
sudo $(target)/etc/backuppc stop |
sudo $(target)/etc/backuppc stop |
25 |
|
|
26 |
install-etc: |
install-etc: |
27 |
test -d $(target)/etc || cp -r etc $(target) && chmod 755 $(target)/etc/backuppc |
test -d $(target)/etc || sudo cp -r etc $(target) && sudo chmod 755 $(target)/etc/backuppc |
28 |
|
|
29 |
|
update: |
30 |
|
sudo -u backuppc /data/backuppc/bin/BackupPC_updatedb |
31 |
|
|
32 |
|
index: test |
33 |
|
sudo rm -Rf /data/backuppc/data/casket || true |
34 |
|
sudo -u backuppc /data/backuppc/bin/BackupPC_updatedb -i |
35 |
|
|
36 |
|
xls: |
37 |
|
sudo -u backuppc /data/backuppc/bin/BackupPC_xls_report && cp -vf /tmp/report.xls ~/public_html/ |
38 |
|
|
39 |
asa: |
asa: |
40 |
rm -Rf $(tmp) |
rm -Rf $(tmp) |
41 |
svn export . $(tmp) |
svn export . $(tmp) |
42 |
rsync -rav $(tmp) 10.210.99.1:backuppc-svn/ |
rsync -rav $(tmp) 10.210.99.1:backuppc-svn/ |
43 |
rm -Rf $(tmp) |
rm -Rf $(tmp) |
44 |
|
|
45 |
|
profile: test |
46 |
|
test -e tmon.out || touch tmon.out |
47 |
|
sudo chown backuppc tmon.out |
48 |
|
dropdb $(db) || echo "skip drop db" |
49 |
|
createdb $(db) |
50 |
|
date > $(profile_file) |
51 |
|
echo "## NORMAL RUN" >> $(profile_file) |
52 |
|
sudo -u backuppc /data/backuppc/bin/BackupPC_updatedb -c $(profile_opt) | tee -a $(profile_file) |
53 |
|
echo "## DProf RUN" >> $(profile_file) |
54 |
|
sudo -u backuppc perl -d:DProf /data/backuppc/bin/BackupPC_updatedb -d $(profile_opt) |
55 |
|
dprofpp 2>&1 | tee -a $(profile_file) |
56 |
|
echo "## DBI_PROFILE RUN" >> $(profile_file) |
57 |
|
DBI_PROFILE=2 sudo -u backuppc /data/backuppc/bin/BackupPC_updatedb -d $(profile_opt) 2>&1 | tee -a $(profile_file) |
58 |
|
mv $(profile_file) profile.`perl -e 'my @p = glob("profile.[0-9]*"); print scalar @p + 1'` |
59 |
|
|