archive-logs

Iteratively archive newline separated log files

git clone https://git.8pit.net/archive-logs.git

 1#!/bin/sh
 2. "${0%/*}/common.sh"
 3
 4cat >current/file1 <<-EOF
 5	fooooobaaarr
 6	foobar
 7EOF
 8
 9mkdir current/ignored
10cat >current/ignored/file2 <<-EOF
11	test123
12	barfoooooooo
13EOF
14cat >current/ignored/file3 <<-EOF
15	1
16	2
17EOF
18chmod -w current/ignored/*
19
20cat >current-expected/file1 <<-EOF
21	foobar
22EOF
23
24cat >archive-expected/file1 <<-EOF
25	fooooobaaarr
26EOF
27
28archive_logs -e "ignored.*"
29rm -r current/ignored </dev/null
30check_dirs