Delete files by date

Questions and answers on how to get the most out of FFAStrans
momocampo
Posts: 594
Joined: Thu Jun 08, 2017 12:36 pm
Location: France-Paris

Delete files by date

Post by momocampo »

Hello all,

I keep on discover this great software and I want now to delete my video files depending on their creation date. I think I must use a conditional nod but I can't find how do this.
For example, if I want to delete all files older than 2 months how I can do?? I found the "s_original_date" variable but which is the variable for the date of the day?
Well if someone can help me it will be really kind.
Thank you and cheer ;)
admin
Site Admin
Posts: 1680
Joined: Sat Feb 08, 2014 10:39 pm

Re: Delete files by date

Post by admin »

Hi, sorry for the late reply.

The %s_original_date% is taken from time modified. If you want to use FFAStrans to delete files older than X, I suggest you do it by running a script from a workflow that's in daily use. Use the "Command executor"-node to launch a script that delete files. A quick search on the web will give you examples:
https://stackoverflow.com/questions/510 ... han-n-days

-steinar
momocampo
Posts: 594
Joined: Thu Jun 08, 2017 12:36 pm
Location: France-Paris

Re: Delete files by date

Post by momocampo »

Hello,
Well, I used forfiles command but I have some problems...I began to use the command in dos mode (cmd) and it works :
forfiles /m *.* /D -60 /C "cmd /c move @file C:\User\Benjamin\Desktop\5"
The 2 files older than 60 days move to "5" folder,it works.

When I try to use this command in FFastrans (command executor), I have success in FFastrans but nothing happens, no file move. I try to display the console and I saw the message "access denied" for each file.
Here is the ffastrans command :
%comspec% /c " forfiles /m *.* /D -60 /C "cmd /c move @file C:\Users\Benjamin\Desktop\5""
(I tried with move command but I will use del in future)

I tried to start FFastrans in administrator too but same problem.
Someone can help me please?

Cheers.
admin
Site Admin
Posts: 1680
Joined: Sat Feb 08, 2014 10:39 pm

Re: Delete files by date

Post by admin »

Ok, so where will forfiles find the the "*.*" files? You don't seem to specify folder... If you manually cd into the folder where you want the files moved then it's ok, but FFAStrans does not do that. So whenever you're working with files in scripts and/or FFAStrans, always specify folder.

-steinar
momocampo
Posts: 594
Joined: Thu Jun 08, 2017 12:36 pm
Location: France-Paris

Re: Delete files by date

Post by momocampo »

Hello Steinar,

Happy you answer me :)
Ok, I understand now and I tried your advice and it works :) but I have a message in the monitor status.
Example : 4 files in a folder and 3 of them are older than 60 days. The 3 files move well but I have this message in monitor : cannot locate source : "x\test\soiree2.mov"
I have only 1 message for 1 file even I have 10 files which have to be process.

Otherwise it works and I have to thank to you Steinar for this great software!!

See you.
Cheers.
admin
Site Admin
Posts: 1680
Joined: Sat Feb 08, 2014 10:39 pm

Re: Delete files by date

Post by admin »

Thanks! :-)

Ok, so FFAStrans will try and read what your command line outputs via std output. And it does this in a loop (every second or so) and extracts the last line from the std output and presents it in the status monitor. FFAStrans does not really know what the output is because it does not know what your command does. It just starts it and tries to read the output. So my guess is that your command will show "cannot locate source : "x\test\soiree2.mov"" as (one of) the last lines if manually run in a dos window.

Hope this clarifies.

-steinar
momocampo
Posts: 594
Joined: Thu Jun 08, 2017 12:36 pm
Location: France-Paris

Re: Delete files by date

Post by momocampo »

Hello Steinar,

Yes I think I understand but I tried to execute the same command in dos and I just have:
1 fichier déplacé (file moved (sorry i'm French)).
So In dos mode this command is ok that's why I don't really understand why FFastrans write this message. More, the file which doesn't match with this modified date (/D -60) does an error in monitor status :"process exited with error code:1 (aucun fichier trouvé avec le critère spécifié)" (no files found with the specified criteria).

Anyway, I have another question about something else, hope I don't disturb too much :)
I want to trigger process at a fixed hour (2:12 am for example), but I don't know how do that. Do I use conditional node and if yes can you help me with an example please?
Thank you very much again !!!

;)
Benjamin
Ray4x4x4
Posts: 11
Joined: Tue Nov 29, 2016 4:54 pm

Re: Delete files by date

Post by Ray4x4x4 »

Hi Benjamin

you may want to look into FolderAgent. It was free to download just last year. The developer had the idea, but stopped working on its development some time ago and offered it for free for those who stumbled upon it. I think they have gone on to other ventures leaving the software behind. it is still available from some download sites. very handy program and fits into the FFAStrans mindset for a broadcaster's full time job is something other than writing scripts.

https://fr.freedownloadmanager.org/Wind ... ATUIT.html

For those more complicated situations, a not too expensive program http://www.makebatchfiles.com/ is highly useful for the part time code warrior.
It allows you to create scripts using pull downs, fill in the blanks etc. I think it was or is, a University class project out of India.

Good luck

Cheers,
User avatar
kibi
Posts: 106
Joined: Mon Feb 29, 2016 12:57 pm
Contact:

Re: Delete files by date

Post by kibi »

I want to trigger process at a fixed hour (2:12 am for example), but I don't know how do that.
You can use Windows Task Scheduler - it's the standard component of any modern Windows OS. It has neat GUI and simple wizards to create and manage tasks.
Alexander Sorkin
momocampo
Posts: 594
Joined: Thu Jun 08, 2017 12:36 pm
Location: France-Paris

Re: Delete files by date

Post by momocampo »

Hello,

@Ray4x4x4 : Thank you very much for all these advices :) I think I will learn this with attention ;)

@ Kibi : Yes I know the windows task sheduler but it was just to "concentrate" all my tasks in only 1 software. Thnaks anyway ;)
Post Reply