Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
General Discussion
 RoboTask Forum : General Discussion
Subject Topic: monitor a folder and unzip files Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
robohobo
Newbie
Newbie
Avatar

Joined: 26 April 2007
Location: United Kingdom
Online Status: Offline
Posts: 3
Posted: 26 April 2007 at 3:32pm | IP Logged Quote robohobo

Hi all, I want to monitor a folder and unzip the archive files as they come in from FTP how can this be done with this software?

I tried myself but i keep getting errors.

PS i'm not a natural programmer more of a graphic designer.


__________________
Sit down and tell me your story
Back to Top View robohobo's Profile Search for other posts by robohobo
 
Oleg
Admin Group
Admin Group
Avatar

Joined: 16 April 2004
Online Status: Offline
Posts: 1133
Posted: 27 April 2007 at 3:35am | IP Logged Quote Oleg

Probably the task tries to unzip file that not has been downloaded completely yet.

Try to insert "Wait for file" action before unzipping. This action will wait until the downloading has finished.



__________________
Oleg Yershov
Back to Top View Oleg's Profile Search for other posts by Oleg Visit Oleg's Homepage
 
robohobo
Newbie
Newbie
Avatar

Joined: 26 April 2007
Location: United Kingdom
Online Status: Offline
Posts: 3
Posted: 27 April 2007 at 4:07am | IP Logged Quote robohobo

Thanks for the reply, I was testing it on a downloaded file. I created a folder called 'Zipped files'  I then set robotask to monitor the folder for new files, if it found a *.zip file it should unzip it.

I have since found out that this program can only deal with .zip files, thats very limiting, unfortunately people send me archive files in various forms; including .rar, .ace etc. in fact the majority of files are .rar because of better compression over .zip files.

 I start the task a then drop a zip file into the folder, the task runs then...

This is what I get in my log:

I: 27/04/2007 10:01:36: ****** Starting task... ******************
I: 27/04/2007 10:01:36: Task started with priority: Normal
I: 27/04/2007 10:01:36: Executing "Extract Files"
I: 27/04/2007 10:01:36: Input file does not exist
E: 27/04/2007 10:01:36: Probably bad archive (List index out of bounds (1))
E: 27/04/2007 10:01:36: An error occured. Step #0 (Extract Files).
E: 27/04/2007 10:01:36: Task execution is aborted

There is nothing wrong with the file and I can unzip it. I think it doesn't like winrar; if thats the program its trying to use to unzip the file, else its windows proprietry extract utility, but that works too. I think its the logic side i'm getting wrong and i ain't into logic


Edited by robohobo on 27 April 2007 at 4:08am


__________________
Sit down and tell me your story
Back to Top View robohobo's Profile Search for other posts by robohobo
 
robohobo
Newbie
Newbie
Avatar

Joined: 26 April 2007
Location: United Kingdom
Online Status: Offline
Posts: 3
Posted: 27 April 2007 at 4:12am | IP Logged Quote robohobo

here is the task file:
;**********************
;* RoboTask Task file *
;* Do not edit!       *
;**********************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1981091247
ContinueOnError=INTEGER|0
Events=FOLDER
ExternalName=STRING|"Task2"
Hide=INTEGER|0
ID=INTEGER|1879346195
Name=STRING|"Extract Files..."
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3

[Actions]
Action1=FOLDER

[Actions\Action1]
ActionID=STRING|"A_ZIP_EXTRACT"
Enabled=INTEGER|-1
Name=STRING|"Extract Files"
Params=FOLDER

[Actions\Action1\Params]
destdir=STRING|"C:\Documents and Settings\Lee\Desktop\zip folder"
filetounzip=STRING|"*.zip"
overwrite=STRING|"0"
password=STRING|"2488926474257142545418538"
skipolderfiles=STRING|"0"
unzipfiles=STRING|"*.*"
usefoldernames=STRING|"0"

[Events]
Event1=FOLDER

[Events\Event1]
Enabled=INTEGER|-1
EventID=STRING|"E_FILE_MONITOR"
Params=FOLDER

[Events\Event1\Params]
chg=STRING|"0"
chga=STRING|"1"
chgsl=STRING|"1"
chgsm=STRING|"1"
chgtl=STRING|"1"
chgtm=STRING|"1"
del=STRING|"0"
folder1=STRING|"C:\Documents and Settings\Lee\Desktop"
foldercount=STRING|"1"
id=STRING|"BTUOYWWF1"
incmask=STRING|"*.*"
interval=STRING|"60"
listmode=STRING|"1"
mon_files=STRING|"1"
mon_folders=STRING|"0"
new=STRING|"1"
saveresults=STRING|"0"
subfolders1=STRING|"1"


__________________
Sit down and tell me your story
Back to Top View robohobo's Profile Search for other posts by robohobo
 
Oleg
Admin Group
Admin Group
Avatar

Joined: 16 April 2004
Online Status: Offline
Posts: 1133
Posted: 27 April 2007 at 5:12am | IP Logged Quote Oleg

For more compatibility you can use external utility, such as WinRAR. It supports command line parameters and most popular formats of packed files.

See "Run program/Open document" action.

__________________
Oleg Yershov
Back to Top View Oleg's Profile Search for other posts by Oleg Visit Oleg's Homepage
 
Aster
Newbie
Newbie


Joined: 06 September 2008
Online Status: Offline
Posts: 4
Posted: 07 September 2008 at 12:54pm | IP Logged Quote Aster

I'm having the same confusion.  I want to simply have Robotask monitor a folder and, if it finds a .zip file, unzip it.

So, for instance I have a .zip file in a folder called "Test" on my desktop.  I have tried using the Extract files action, with the "File to Unzip" pointing to
C:\Documents and Settings\R\Desktop\Test\*.zip
and the destination folder set to
C:\Documents and Settings\R\Desktop\Test\
and the "files to unzip" set to
*.*

However, when I run the task, it gives me:
I: 9/7/2008 1:43:32 PM: Executing "Extract Files"
I: 9/7/2008 1:43:32 PM: Input file does not exist
E: 9/7/2008 1:43:32 PM: Probably bad archive (List index out of bounds (1))
E: 9/7/2008 1:43:32 PM: An error occured. Step #0 (Extract Files).

Am I setting the task up wrong?

Back to Top View Aster's Profile Search for other posts by Aster
 
Oleg
Admin Group
Admin Group
Avatar

Joined: 16 April 2004
Online Status: Offline
Posts: 1133
Posted: 08 September 2008 at 6:46am | IP Logged Quote Oleg

In order to unpack file you have to use the file name (not the mask)

If you want to unpack many files, or you don't know the filename beforehand you may use file loop

File Loop // by *.zip files
   Extract Files //from current file
End Loop


__________________
Oleg Yershov
Back to Top View Oleg's Profile Search for other posts by Oleg Visit Oleg's Homepage
 
Aster
Newbie
Newbie


Joined: 06 September 2008
Online Status: Offline
Posts: 4
Posted: 08 September 2008 at 6:07pm | IP Logged Quote Aster

Got it, thanks Oleg!

It took a bit of headscratching because I don't know much more than the basic logic behind coding, but I figured it out.  To help anyone who comes by wondering how to do this (like me!), I'll give the elaboration on Oleg's suggestion:

First action:File Loop
--Parameters: 
---Loop Kind: by files only
---Search in: whatever directory you want to monitor, and use a wildcard so it looks for zip files (for me:  C:\Documents and Settings\R\Desktop\Test\*.zip)
---Assign Current Filename to Variable: UNZIPME

Second action: Extract Files
--Parameters: 
---File to Unzip:  {UNZIPME}
---Destination Folder:  wherever you want the files unzipped to.
---Files to Unzip:  *.*

Third action:  End Loop

Fourth action:  Remove variable "UNZIPME"

Back to Top View Aster's Profile Search for other posts by Aster
 
WouterVK
Newbie
Newbie


Joined: 18 June 2010
Online Status: Offline
Posts: 1
Posted: 18 June 2010 at 5:07am | IP Logged Quote WouterVK

Hey Aster,

 

when I use your actions, robotask just unpacks ONE file. No errors, but the other files stay unzipped. :(

Back to Top View WouterVK's Profile Search for other posts by WouterVK
 
Aster
Newbie
Newbie


Joined: 06 September 2008
Online Status: Offline
Posts: 4
Posted: 18 June 2010 at 7:00am | IP Logged Quote Aster

I forget whether I tried more than one file when I was
testing this. Usually I only get a .zip in a blue moon,
so maybe I didn't catch that one.

Some thoughts, though: if you specifically run the
program on the folder again, does it then find another
.zip file in the folder and unpack that one? Maybe it's
only running one pass of the commands and not searching
again after it's finished? Perhaps an action needs to be
put onto the end to run it again if there are still files
in the folder or somesuch. Something akin to the If/then
loop set up [URL=http://mail.robotask.com/forum/forum_posts.asp?
TID=679&PN=1&get=last]here[/URL]?

Unfortunately, since then I've switched computers and
lost the full Robotask, so I don't have all the options
anymore (like file loop). :( So you'll be on your own
for actual testing...
Back to Top View Aster's Profile Search for other posts by Aster
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.1558 seconds.