PDA

View Full Version : Call a saved queue in raw command


MPOWER
05-25-2015, 03:27 AM
I am trying to build a set of custom commands. Is there any way to include the load of a saved queue?
One other thing. It the set of Raw commands how can I change directory and select other files from other directory on the same server as well?

example:

/lcd c:\myLocalfolder
/activate local
/select -f
/delete selected
/activate remote
/cd /data/indices/my_index/
/select -f *lst.csv
/cd/data/WORLD/my_remote_files/
/select -f *lst.csv
/queue selected


Thanks in advance

MPOWER
05-25-2015, 03:39 AM
I fixed it like in the following example:

/lcd c:\myLocalfolder
/activate local
/select -f
/delete selected
/activate remote
/cd /data/indices/my_index/
/select -f *lst.csv
/queue selected
/cd/data/WORLD/my_remote_files/
/addselect -f *lst.csv
/queue selected

DayCuts
05-25-2015, 09:07 AM
I would second the /loadqueue /savequeue suggestion, it would be useful to be able to manipulate a queue file using a custom command. I was just wondering about this the other day. I see I can use cli switches to automate queue manipulation but I have yet to test have efficiently it can be done as I have not had the time.

I am wondering if the -raw cli switch can launch a custom command such as -raw="/mycmd" so one could do for example...

flashfxp.exe "SITE1" -pass="" -lock -quit -queue="queuefile" -savequeue -raw="/updatequeuefile"

or with the potential load/save queue commands...

flashfxp.exe "SITE1" -pass="" -lock -quit -raw="/updatequeuefileX"

I know I am going OT here but I was also wondering if their were any plans to extend the -id cli switch, such as allowing -raw actions to be appended if the ID session is still active. For example if multiple external sources launch flashfxp via cli to perform simple raw commands they don't need to spawn new sessions if there is say a session with id "RAWCMS" already open...

flashfxp.exe -id="RAWCMDS" -pass="" -lock -quit -raw="somecmd"
flashfxp.exe -id="RAWCMDS" -pass="" -lock -quit -raw="somecmd2"
flashfxp.exe -id="RAWCMDS" -pass="" -lock -quit -raw="somecmdN"

If they are triggered to run at different times or events then currently you have to spawn and close sessions each time. You could write a queue file and use the -id -queue support but it is not necessarily efficient or desirable to be writing/deleting temporary files.

bigstar
05-27-2015, 08:41 AM
I fixed it like in the following example:

/lcd c:\myLocalfolder
/activate local
/select -f
/delete selected
/activate remote
/cd /data/indices/my_index/
/select -f *lst.csv
/queue selected
/cd/data/WORLD/my_remote_files/
/addselect -f *lst.csv
/queue selected

Not sure if you made a mistake in your post or in your raw command script but the following line is not valid
/addselect -f *lst.csv

You'd want to use
/select -f *lst.csv

bigstar
05-27-2015, 10:40 AM
I would second the /loadqueue /savequeue suggestion, it would be useful to be able to manipulate a queue file using a custom command. I was just wondering about this the other day. I see I can use cli switches to automate queue manipulation but I have yet to test have efficiently it can be done as I have not had the time.


I will add the following commands to the next build.
/loadqueue <filename>
/savequeue <filename>


I am wondering if the -raw cli switch can launch a custom command such as -raw="/mycmd" so one could do for example...

flashfxp.exe "SITE1" -pass="" -lock -quit -queue="queuefile" -savequeue -raw="/updatequeuefile"

or with the potential load/save queue commands...

flashfxp.exe "SITE1" -pass="" -lock -quit -raw="/updatequeuefileX"


This is a very interesting idea.

You would need to pass the predefined command to be performed as a command block "[updatequeuefileX]"

After performing some tests I discovered some limitations with the current design that would prevent this from working.

When you use the -raw switch it creates a queue entry to execute the command, this entry is added after the queue file is loaded, placing it at the end of the queue. (The switch order has no relevance)

I can change this behavior so that the raw command is always inserted into the top of the queue to execute first.

But now we have another problem, since the raw command is executed via the queue we need a way to stop it immediately after the last command is executed, if we use the /stop command to abort the queue then we introduce a new problem that prevents us from automatically closing flashfxp via the -quit switch. additional changes would be needed to make this work.

I will need to continue evaluating this idea to see if it can be done without making things overly complicated.


I know I am going OT here but I was also wondering if their were any plans to extend the -id cli switch, such as allowing -raw actions to be appended if the ID session is still active. For example if multiple external sources launch flashfxp via cli to perform simple raw commands they don't need to spawn new sessions if there is say a session with id "RAWCMS" already open...

flashfxp.exe -id="RAWCMDS" -pass="" -lock -quit -raw="somecmd"
flashfxp.exe -id="RAWCMDS" -pass="" -lock -quit -raw="somecmd2"
flashfxp.exe -id="RAWCMDS" -pass="" -lock -quit -raw="somecmdN"

If they are triggered to run at different times or events then currently you have to spawn and close sessions each time. You could write a queue file and use the -id -queue support but it is not necessarily efficient or desirable to be writing/deleting temporary files.

Since a raw command passed via the CLI is transformed into a queue item which gets added to the queue anyways I think it might be more practical using a temporary queue file.

Also in my answer to your previous question I talked about changing -raw to insert the command at the top of the queue, that change would cause commands to be executed in the wrong order if something like this was allowed.

Oh and you would also need to pass the site name via the CLI which is missing from your example above
(I suspect a slight oversight on your post)

MPOWER
06-02-2015, 01:55 AM
Not sure if you made a mistake in your post or in your raw command script but the following line is not valid
/addselect -f *lst.csv

You'd want to use
/select -f *lst.csv

You are right, it was just a typo.
The command I used and worked was the
/andselect -f *lst.csv