ntop / n2disk

Open source components and extensions for n2disk
498 stars 11 forks source link

n2disk is not saving erased pcaps on archive folder #18

Closed igorribeiroduarte closed 4 years ago

igorribeiroduarte commented 4 years ago

Hello,

I'm using the following command to run n2disk: n2disk -I -A /var/index_folder -p 1024 -b 1024 -i nt:1 -n 1000 -m 1000 -t 15 -O /tmp -o /disco04

For some reason the pcaps erased from /disco04 dir are not being saved on the tmp folder specified on -O option. Did I forget some argument?

Thanks in advance

cardigliano commented 4 years ago

I was able to reproduce this, a fix has been pushed to both latest stable and dev. Please note that files are moved under the folder specified in -O using the original sub-path with respect to the folder specified in -o. We usually do not recommend using this option as a better alternative is to use the --exec-cmd option that lets you create your custom script for moving files in a secondary storage with your custom logic and structure.

koutsupcom commented 4 years ago

Hello,

I need to rename the dumped file with n2disk, can you tell me an example with --exec-cmd option?

Thanks in advance

cardigliano commented 4 years ago

--exec-cmd executes the binary providing the pcap file name as argument, you can provide for instance the path of a simple bash script that does "mv $1 $1.bkp"

koutsupcom commented 4 years ago

Nice. Thank you for your quick response.