14 lines
401 B
Makefile
14 lines
401 B
Makefile
|
NAME = backupdb
|
||
|
BINDIR = /usr/local/bin
|
||
|
BACKUPDIR = /var/lib/backupdb
|
||
|
|
||
|
install:
|
||
|
install --mode=755 $(NAME) $(BINDIR)
|
||
|
if [ ! -d $(BACKUPDIR) ]; then mkdir -p $(BACKUPDIR); fi
|
||
|
echo "0 2 * * * root $(BINDIR)/$(NAME)" >> /etc/crontab
|
||
|
|
||
|
uninstall:
|
||
|
if [ -f $(BINDIR)/$(NAME) ]; then rm $(BINDIR)/$(NAME); fi
|
||
|
if [ -d $(BACKUPDIR) ]; then rm -r $(BACKUPDIR); fi
|
||
|
sed -i '/$(NAME)/d' /etc/crontab
|