backupdb/Makefile

14 lines
401 B
Makefile
Raw Normal View History

2019-12-25 20:01:23 +01:00
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