Backup your tasks

Discuss RoboTask here

Re: Backup your tasks

Postby psbtheone » Wed Jun 10, 2020 7:07 am

Hi Oleg,

Thanks for your sharing this good task for backup of all tasks to a certain location. But, after exporting tasks, its difficult to identify a task by name in backup location, so i have created one subtask to be called from this backup task.

This subtask will read each task for its name and rename the task to its name before exporting it to a backup location.

Check this subtask:
ExportTaskWithName.tsk
Code: Select all
;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1723571677
Comment=STRINGLIST
ContinueOnError=INTEGER|1
ExternalName=STRING|"Task39"
Hide=INTEGER|0
ID=INTEGER|368097659
LocalVariables=STRING|"CNT1=,name=,NAME1=,POSITION=,TEXT="
LogOnAsUser=INTEGER|1
Name=STRING|"ExportTasks"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER

[Actions\Action1]
ActionID=STRING|"A_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop"
Params=FOLDER

[Actions\Action1\Params]
createmode=STRING|"1"
date1=STRING|"20200307"
date2=STRING|"20200307"
destvar=STRING|"TSKFILE"
DuringDays=STRING|"1"
DuringHours=STRING|"1"
DuringMinutes=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"{TaskFolder}\*.tsk"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderHours=STRING|"1"
OlderMinutes=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
searchkind=STRING|"0"
sort=STRING|"1"
sortby=STRING|"1"
sortorder=STRING|"1"
subdirs=STRING|"1"
timesize=STRING|"0"
WithoutPath=STRING|"0"

[Actions\Action10]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

[Actions\Action11]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

[Actions\Action2]
ActionID=STRING|"A_LOOP_SIMPLE"
Enabled=INTEGER|-1
Name=STRING|"Simple Loop"
Params=FOLDER

[Actions\Action2\Params]
begin=STRING|"10"
end=STRING|"20"
variable=STRING|"CNT1"

[Actions\Action3]
ActionID=STRING|"A_TXT_EXTRACTLINE"
Enabled=INTEGER|-1
Name=STRING|"TXT Extract Line"
Params=FOLDER

[Actions\Action3\Params]
external=STRING|"1"
filename=STRING|"{TSKFILE}"
linecount=STRING|"0"
linenum=STRING|"{CNT1}"
variable=STRING|"TEXT"

[Actions\Action4]
ActionID=STRING|"A_STR_EXTRACT"
Enabled=INTEGER|-1
Name=STRING|"STR Extract"
Params=FOLDER

[Actions\Action4\Params]
amount=STRING|"13"
from=STRING|"1"
source=STRING|"{TEXT}"
variable=STRING|"position"

[Actions\Action5]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action5\Params]
case=STRING|"1"
connection=STRING|"0"
count=STRING|"1"
operator=STRING|"0"
type=STRING|"0"
value1=STRING|"{POSITION}"
value2=STRING|"Name=STRING|"""

[Actions\Action6]
ActionID=STRING|"A_STR_EXTRACT"
Enabled=INTEGER|-1
Name=STRING|"STR Extract"
Params=FOLDER

[Actions\Action6\Params]
amount=STRING|"200"
from=STRING|"14"
source=STRING|"{TEXT}"
variable=STRING|"name"

[Actions\Action7]
ActionID=STRING|"A_STR_TRIM"
Enabled=INTEGER|-1
Name=STRING|"STR Trim"
Params=FOLDER

[Actions\Action7\Params]
custom=STRING|"1"
customchar=STRING|""""
eol=STRING|"0"
lead=STRING|"1"
source=STRING|"{name}"
spaces=STRING|"0"
tabs=STRING|"0"
trailing=STRING|"1"
variable=STRING|"name1"

[Actions\Action8]
ActionID=STRING|"A_FILE_COPY"
Enabled=INTEGER|-1
Name=STRING|"Copy/Move File"
Params=FOLDER

[Actions\Action8\Params]
destdir=STRING|"{TODAYFOLDER}"
f_count=STRING|"1"
file0=STRING|"{TSKFILE}"
hidden=STRING|"1"
ifexists=STRING|"0"
move=STRING|"0"
rename=STRING|"1"
renamemask=STRING|"{name1}.tsk"
subdir=STRING|"0"
system=STRING|"1"

[Actions\Action9]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

psbtheone
 
Posts: 2
Joined: Wed Jun 10, 2020 6:43 am

Re: Backup your tasks

Postby Oleg » Wed Jun 10, 2020 10:32 am

Very good.
Also look at the these demo tasks (included into installation package):
  • [DEMO] Retrieve task names - it creates the file map.txt in the task folder. Each line looks like this
    06C2F733 = Retrieve task names
    task_file_name = Task_name
  • [DEMO] Retrieve task parameters to CSV - it creates CSV file map.csv wth three fields:
      Task_File_Name
      Task_Name
      Task_External_Name
    You can import this file into Excel and sort the list by any column
Oleg Yershov
Oleg
Site Admin
 
Posts: 2668
Joined: Thu Jan 01, 1970 1:00 am

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 10 guests