Changing dump name each X steps

Dear lammps mailing list users
I have a simulation for which I need to dump the data each single time step.The entire simulation is very long so I want to change the dump file name each X steps so I can do the post processing easier.
What I am doing now is simply run a loop with a variable and using undump and dump inside a loop. something like :

Dear lammps mailing list users
I have a simulation for which I need to dump the data each single time
step.The entire simulation is very long so I want to change the dump file
name each X steps so I can do the post processing easier.

this is a very questionable approach. this will create a massive
amount of data and you will spend much more time with formatting and
parsing numbers for formatted i/o than for everything else. what kind
of post processing are you doing that requires this kind of treatment?
wouldn't it be better to do this kind of analysis *during* the MD. in
MD adjacent time steps are usually strongly correlated and thus
contain very little statistical relevant information. also LAMMPS has
many compute styles and it is pretty easy to add new ones.

What I am doing now is simply run a loop with a variable and using undump
and dump inside a loop. something like :
****************
label loopa
dump 1 all local 1 bonds${a}.dump index c_1[1] c_1[2] c_1[3]
dump 2 all custom 1 dump${a}.vel id vx vy vz
dump 3 all custom 1 dump_all${a}.vel id vx vy vz

why on earth are you dumping then same information twice??

print ' were in itiration \{a\} ' run {run_change}
undump bondlistdump_all
undump myvels
undump myvels_all
next a
jump ${path} loopa
****************
But I am guessing that this is very inefficient and slows down the
simulation, is there a better way to achieve this ?

have a look at then various options for output file naming at then
dump command documentation. a simple option would be to encode then
time step number into the file name.

Also is there a way in dump command to specify a path where to save the data
(not from where I run the script)?

i have no idea what you mean by this statement. you can provide path
names with directory components and you can switch the working
directory from within the lammps script language. see the shell
command.

axel.