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

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
You should be able to copy it:

1
2
3

cp debug.log debug.save
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.