how to take backup of a file without stopping the running process

Oct 27, 2014 at 10:07am
Hi

I need to take the backup of a debug file with out stopping that process. Could you please me how to make it in unix.

Thanks in advance
Last edited on Oct 27, 2014 at 10:08am
Nov 4, 2014 at 2:47pm
You should be able to copy it:

1
2
3

cp debug.log debug.save
Nov 9, 2014 at 7:34am
Find PID of your process:

$ ps -C a.out
1234 ? 00:00:00 a.out

Attach gdb to this process:

$ gdb
(gdb) attach 1234

And make core file

(gdb) generate-core-file

Later you can reload it by

$ gdb ./a.out core.1234

Topic archived. No new replies allowed.