You are here

Flow controll !!! help with a bit of scripting

12 posts / 0 new
Last post
CXer0
Offline
Last seen: 13 years 9 months ago
Joined: 2010-12-13 07:46
Flow controll !!! help with a bit of scripting

hello forum
i've searched around a bit for this but not too hard so perhaps this has already been asked.
heres my question(/s).
can i use this as a script in toucan 3.x ?

day = os.date("%A")
month= os.date("MM")
if day == "monday" then
backup("weeklybackup")
else
sync("dailysync") ''almost
if month == ("january") and day == ("monday") then
secure("yearencrypt")
end
also how can i use automatic password with what command, so that it doesn't ask me any???
thanks in advance

Steve Lamerton
Steve Lamerton's picture
Offline
Last seen: 11 years 2 months ago
Developer
Joined: 2005-12-10 15:22
I think

perhaps what you want is something like this:

day = os.date("%A")
month= os.date("MM")
if month == ("january") and day == ("monday") then
   secure("yearencrypt")
elseif day == "monday" then
    backup("weeklybackup")
else
   sync("dailysync")
end

If not explain in a little more detail and I would be glad to help! The best way of inputting a password at the moment is if you are running this from a batch file then you can pass the password on the command line.

CXer0
Offline
Last seen: 13 years 9 months ago
Joined: 2010-12-13 07:46
more detail

what i want to do is a sync job to the same computers local hdd every week then do a backup every month and and encryption every year.
thank you for the fast reply Smile

ok a batch file but what commands do i use --password ??? or -K or -p or something like that ??
on the command line ... is manual input needed
i really would like to make it automatic

also that script does make a lot more sense ill try it and see what happens when i mess around with my time settings Smile

Yesterday is history, Tomorrow is a mystery, but Today is a Gift, thats why its called a Present. Smile

CXer0
Offline
Last seen: 13 years 9 months ago
Joined: 2010-12-13 07:46
source path is invalid well

source path is invalid

well i tried it out but now it wants this and i don't really know what it wants cos everything seems to be fine in the jobs themselves
also is batching same like scripting i mean what do i need to but in to a batch file

oh and i think i found a little inconvenience by the scripting page
if you select another saves script it will add itself to the first line without first deleting everything in the script window (toucan 3.1)

Yesterday is history, Tomorrow is a mystery, but Today is a Gift, thats why its called a Present. Smile

CXer0
Offline
Last seen: 13 years 9 months ago
Joined: 2010-12-13 07:46
lol

well now i tried deleting the sync command and that was it doesn't need a source path anymore but ...
i doesn't seem to do anything else as well.:(:?
so i thought well isn't MM the short version in system date and tried MMMM but that didn't do any good either

C:\Documents and Settings\Administrator\My Documents
this is the source path that doesn't seem to be liked(why?)

Yesterday is history, Tomorrow is a mystery, but Today is a Gift, thats why its called a Present. Smile

CXer0
Offline
Last seen: 13 years 9 months ago
Joined: 2010-12-13 07:46
another question

now im like a raving lunatic talking to myself
but hell heres another question
i was making totally new jobs on the script line and toucan 3.1 gives you some
like:
backup({[[path1]], [[path2]]}, [[location]], [[function]], [[format]], ratio, {password = false, test = false, solid = true}, [[rules]])

i really get what is meant with path1 and path2 from sync but when location gets added into the mix i just ... say wah ????
so please clarify what goes to where, in backup. plspls (

Yesterday is history, Tomorrow is a mystery, but Today is a Gift, thats why its called a Present. Smile

CXer0
Offline
Last seen: 13 years 9 months ago
Joined: 2010-12-13 07:46
trouble

im getting more confused by the minute
i created a batch file where i made a job to sync into a folder but when i ran the batch it doesn't do much (well dos windows first one stays (the original batch window)and another briefly to do the job i guess)
so i go to the folder where i made the job to sync and see an empty folder (i see hidden folders so no there was nothing)
well heres the code:
C:\Toucan2\Toucan.exe Sync1
pause

(this is with the 3.1 version of toucan again)

Yesterday is history, Tomorrow is a mystery, but Today is a Gift, thats why its called a Present. Smile

CXer0
Offline
Last seen: 13 years 9 months ago
Joined: 2010-12-13 07:46
things i want

i would really like to use toucan as my backup program that also encrypts files (backups in my case) without me, the user, even noticing
so i need the program to automatically insert my given password
but so far i've been stonewalled by the program either not accepting my scripts or not doing anything at all and well im to lazy to do it manually

Yesterday is history, Tomorrow is a mystery, but Today is a Gift, thats why its called a Present. Smile

CXer0
Offline
Last seen: 13 years 9 months ago
Joined: 2010-12-13 07:46
resentment

im starting to get slightly angry
cos i tried the batch file again
C:\Toucan3.1\Toucan.exe -j(1)
pause
in Win xp pro
and
C:\Toucan\Toucan.exe -j(Sync1)
in win 7 pro
and neither are showing any results
so what am i doing wrong ????
Sorry for the multiple posting just wanted to update my steps(and anguish)
}:)

Yesterday is history, Tomorrow is a mystery, but Today is a Gift, thats why its called a Present. Smile

CXer0
Offline
Last seen: 13 years 9 months ago
Joined: 2010-12-13 07:46
wohhoo

ugh i hate pungy syntaxes
well i got the batch file to finally work after i noticed that i dont really need the () now il just start trying to use a password on the damn thing

Yesterday is history, Tomorrow is a mystery, but Today is a Gift, thats why its called a Present. Smile

CXer0
Offline
Last seen: 13 years 9 months ago
Joined: 2010-12-13 07:46
walled

u know lamberton u should really put a batch example in the help file

and i seem to have hit another wall, when i try to do a secure with and without
--password=1234
at its end it doesn't really do anything exept sit there. i think i read this somewhere on the forum but i don't really know

Yesterday is history, Tomorrow is a mystery, but Today is a Gift, thats why its called a Present. Smile

CXer0
Offline
Last seen: 13 years 9 months ago
Joined: 2010-12-13 07:46
my solution

well it isn't perfect put it'll do
im going to use task schedule to run the batch file containing the sync and bakup jobs and then do a scripted encryption witch ill use with task schedule.
its far from any good (and still in the "more than average" mode to users)
anyhow how do i close this compilation of my own raewings.
and oops sorry about the name (i first wrote lambert }:))

Yesterday is history, Tomorrow is a mystery, but Today is a Gift, thats why its called a Present. Smile

Log in or register to post comments