Project

General

Profile

« Previous | Next » 

Revision 3438

backups/Makefile: Added %.backup/rotate

View differences:

Makefile
3 3
# Make
4 4
SHELL := /bin/bash
5 5

  
6
# Paths
7
bin := ../bin
6
# OS
7
os := $(shell uname)
8
isMac := $(filter Darwin,$(os))
8 9

  
10
# System
11
dateFmt := %Y-%m-%d-%H-%M-%S
12
mtime = $(shell $(if $(isMac),stat -f %Sm -t "$(dateFmt)" $(1),date\
13
--reference=$(1) +"$(dateFmt)"))
14

  
9 15
# Terminal
10 16
esc := '['
11 17
reset := $(esc)'0m'
......
18 24
$(2),\n$(2))\nContinue? (y/n) ' REPLY; test "$$REPLY" = y && echo t),,\
19 25
$(error Aborting))
20 26

  
27
# Paths
28
bin := ../bin
29

  
21 30
# DB
22 31
psqlVerbose := $(bin)/psql_script_vegbien --echo-all
23 32
pg_dump := $(bin)/pg_dump_vegbien
......
61 70
%.backup/test: %.backup.sql _always
62 71
	rm $<
63 72

  
73
%.backup/rotate: %.backup _always
74
	mv $< $*.$(call mtime,$<).backup
75

  
64 76
#### Archived imports
65 77

  
66 78
confirmRm = $(call confirm,WARNING: This will delete the archived import $(1)!)

Also available in: Unified diff