Skip to contentSkip to conversation

Add restore command

PATCH In review Eric Leblond 2 participants 3 messages Dec 27, 2012 – Jan 5, 2013 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add restore command

This patch adds a 'restore' command to nfacct commands. It takes the output of 'list' command and use it to restore the counters. Basically, the user can save the counter with:
nfacct list >nfacct.dump
And restore them with:
nfacct restore <nfacct.dump

---
 nfacct.8     |    4 ++++
 src/nfacct.c |   59 ++++++++++++++++++++++++++++++++++++++++++++++++----------
 2 files changed, 53 insertions(+), 10 deletions(-)
nfacct.8 +4 -0
index 96c16c2..554bc3b 100644
@@ -17,6 +17,10 @@ specified at any given time.
 .BI "list "
 List the existing accounting object in table.
 .TP
+.BI "restore "
+Restore accounting object table by reading from stdin. Input format is the one used
+as output by the list command.
+.TP
 .BI "add "
 Add new accounting object.
 .TP
src/nfacct.c +49 -10

116 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 6 lines · Eric Leblond

This patch adds a 'restore' command to nfacct commands. It takes the output of 'list' command and use it to restore the counters. Basically, the user can save the counter with:
nfacct list >nfacct.dump
And restore them with:
nfacct restore <nfacct.dump

Thanks a lot, this is good, I was expecting someone to take it and to add support for that :-).

#2 lore raw

Hello,

Quoted 10 lines · Pablo Neira Ayuso
Quoted 6 lines · Eric Leblond

This patch adds a 'restore' command to nfacct commands. It takes the output of 'list' command and use it to restore the counters. Basically, the user can save the counter with:
nfacct list >nfacct.dump
And restore them with:
nfacct restore <nfacct.dump

Thanks a lot, this is good, I was expecting someone to take it and to add support for that :-).

I've just pushed this patch to nfacct git tree.

BR,

Signature · 2 lines
Eric Leblond <[email protected]>
Blog: https://home.regit.org/