Misc tweaks

This commit is contained in:
dave 2017-11-09 17:32:50 -08:00
parent 3bf8bc07ef
commit ef53d180bc
3 changed files with 26 additions and 6 deletions

View File

@ -156,9 +156,13 @@ if __name__ == '__main__':
parser.add_argument("-d", "--dir", required=True, help="user dir to find logs from")
parser.add_argument("-o", "--output", required=True, help="local output dir")
parser.add_argument("-l", "--keep-days", type=int, help="number of days to keep", default=90)
parser.add_argument("-l", "--keep-days", type=int, help="number of days to keep", default=90) # dont fetch anything newer than x days ago (?)
args = parser.parse_args()
f = ZNCLogFetcher(host=args.host, user=args.user, ssh_key=args.key, znc_user_dir=args.dir, output_dir=args.output,
f = ZNCLogFetcher(host=args.host,
user=args.user,
ssh_key=args.key,
znc_user_dir=args.dir,
output_dir=args.output,
keep_days=args.keep_days)
f.run()

View File

@ -1,6 +1,22 @@
#!/usr/bin/env make
all: ilogarchivego
all: ilogarchive
ilogarchivego:
go build -o iloggo src/containers.go src/archive.go
tmp/ilogarchivego.raw: src/containers.go src/archive.go
go build -o tmp/ilogarchivego.raw src/containers.go src/archive.go
tmp/ilogarchivego.stripped: tmp/ilogarchivego.raw
strip tmp/ilogarchivego.raw -o tmp/ilogarchivego.stripped
UPXLEVEL:=-7
ilogarchive: tmp/ilogarchivego.stripped
rm -f ilogarchive
upx $(UPXLEVEL) tmp/ilogarchivego.stripped -o ilogarchive
clean:
rm -f ilogarchive tmp/*
.PHONY: install
install: ilogarchive
cp ilogarchive $(DESTDIR)/usr/local/bin/ilogarchive

View File

@ -21,7 +21,7 @@ def archiveit(output_dir, _channel, _logfiles):
def by_totalsize(logfiles):
"""
Given a list of `LogFile`s, return the total reported size, in bytes
Given a list of `LogFile`s, return the total reported size, in bytes, of the log
"""
return sum([i.bytes() for i in logfiles])