Delete files by date
Delete files by date
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
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
Re: Delete files by date
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
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
Re: Delete files by date
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.
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.
Re: Delete files by date
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
-steinar
Re: Delete files by date
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.
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.
Re: Delete files by date
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
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
Re: Delete files by date
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
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
Re: Delete files by date
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,
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,
Re: Delete files by date
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.I want to trigger process at a fixed hour (2:12 am for example), but I don't know how do that.
Alexander Sorkin
Re: Delete files by date
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
@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