Go Back   FlashFXP Forums > >

Custom Commands Download, share, or get help creating your own.

Closed Thread
 
Thread Tools Display Modes
Old 08-09-2014, 05:12 AM   #1
Shark
Senior Member
FlashFXP Beta Tester
 
Shark's Avatar
 
Join Date: Oct 2001
Posts: 606
Default Delete files by date

Hello,

I would like to keep a remote folder with 30 days worth of files.

Anything older than that, I would like to delete. I can run task every day or so to go in and delete the old files.

I was wondering if there was a way I could do this with FlashFXP or if anyone had any ideas?

Thanks.
Shark is offline  
Old 08-09-2014, 11:17 AM   #2
bigstar
FlashFXP Developer
FlashFXP Administrator
ioFTPD Beta Tester
 
bigstar's Avatar
 
Join Date: Oct 2001
Posts: 8,012
Default

Using the latest FlashFXP v5.0 release you can do this with custom commands.

Code:
/select -f :age+30d
This instructs FlashFXP to select only files with a date/time older than 30 or more days.

Now to make this into a queue entry we can enqueue raw commands by right-clicking the file list and selecting enqueue > raw command from the popup menu.

The whole process is as followed:
1. Connect to the site where you want to perform this operation.
2. Enqueue the following as a single raw command.
(Click the down triangle on the raw command dialog to switch to multi-line mode)
Code:
/cd /folder/you/want/to/delete/from
/select -f :age+30d
/delete selected
3. Save the queue to a file.

Additional Information
The multi-line toggle button on the raw dialog was added in v5.0.0.3756

The reason we're doing this as a single raw command is because we want to abort the command block if the first command (/cd <path>) fails.
bigstar is offline  
Old 08-09-2014, 05:03 PM   #3
Shark
Senior Member
FlashFXP Beta Tester
 
Shark's Avatar
 
Join Date: Oct 2001
Posts: 606
Default

Hi bigstar,

Thanks for the quick reply. I hope has been good.

I am just playing around with the commands now, I noticed that it selected them strange (see attached shot).

Then I was thinking, it may be because the date displayed is "Date Modified" which isn't the actual file date. Then I tried to change it to the real file date, but, there is not the option?

Is there any way I can do that?

Hopefully once I get this done I can set it up as a queue to do it every week via task scheduler.

PS. Your installer does not have a back button. Only next or cancel!

http://clan-tea.com/temp/selection.jpg
Attached Thumbnails
Delete files by date-selection-jpg  

Last edited by Shark; 08-09-2014 at 05:19 PM.
Shark is offline  
Old 08-09-2014, 06:14 PM   #4
Shark
Senior Member
FlashFXP Beta Tester
 
Shark's Avatar
 
Join Date: Oct 2001
Posts: 606
Default

Would the command line for task scheduler be:

FLASHFXP.EXE -c2 -go deletefiles.fqf
Shark is offline  
Old 08-09-2014, 08:03 PM   #5
bigstar
FlashFXP Developer
FlashFXP Administrator
ioFTPD Beta Tester
 
bigstar's Avatar
 
Join Date: Oct 2001
Posts: 8,012
Default

This feature was intended to work with the modified date which is supported by all servers, some servers are capable of providing the created date but currently we don't support this field.

There is a back button for some sections of the installer, its located at the top of the window on the glass caption bar and its a round (<-) arrow button.

If you want to configure windows scheduler directly that will work, but you can also configure it directly within FlashFXP under Tools > Schedule, select the queue file and set the desired schedule, you can even setup an email notification on failure with logs.

As for the selection looking a bit odd, can you sort the list by modified date and verify if everything looks right? I did some selection tests and from what I am seeing everything appears to be working correctly.
bigstar is offline  
Old 08-09-2014, 10:15 PM   #6
Shark
Senior Member
FlashFXP Beta Tester
 
Shark's Avatar
 
Join Date: Oct 2001
Posts: 606
Default

Ah ok, I see what you mean... I wasn't sorted by date. Will test it again with 29 days later today and let you know.

In regards to the FFXP Schedule, does FFXP have to be running though?
Shark is offline  
Old 08-09-2014, 10:47 PM   #7
Shark
Senior Member
FlashFXP Beta Tester
 
Shark's Avatar
 
Join Date: Oct 2001
Posts: 606
Default

I just checked the help and realised it adds to the Windows Task. Thanks again.
Shark is offline  
Old 08-10-2014, 01:02 AM   #8
Shark
Senior Member
FlashFXP Beta Tester
 
Shark's Avatar
 
Join Date: Oct 2001
Posts: 606
Default

Also, those commands you have listed above:

/select -f :age+30d
/delete selected

Where are they all written if I want to have a look?
Shark is offline  
Old 08-10-2014, 08:34 AM   #9
bigstar
FlashFXP Developer
FlashFXP Administrator
ioFTPD Beta Tester
 
bigstar's Avatar
 
Join Date: Oct 2001
Posts: 8,012
Default

The help file for v5.0 is currently work in progress so you will not find everything listed
Help file > Reference >Custom Commands

You can fill in the blanks by reading over the following thread which lists many of the changes
http://www.flashfxp.com/forum/flashfxp/custom-commands/16296-request-custom-command-suggestions.html
(However I am not sure if everything on that thread is 100% accurate, some commands may have been modified/tweaked since my original posting)
bigstar is offline  
Old 08-10-2014, 08:00 PM   #10
Shark
Senior Member
FlashFXP Beta Tester
 
Shark's Avatar
 
Join Date: Oct 2001
Posts: 606
Default

Great, thanks.
Shark is offline  
Closed Thread

Tags
delete, files, flashfxp, ideas, wondering


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:37 AM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)