How can I do that specific array option?

Questions? Suggestions? Need help? Talk about anything related to Yawcam...

How can I do that specific array option?

Postby grar » Tue Feb 28, 2012 6:23 pm

Hello!
I'm using YawCam to see my house when I'm away (I've had some problems but that's not important now).
The thing is that I'd like to have array images during a week, or more-less 2 or 3 days. I use the array image option, but I upload the files using dropbox and the {X} option didn't worked well as everytime it takes a photo it renames all the others. I use the {day} option to create a folder for every day. To solve the dropox thing, I changed and used the {numX} option with num4 to make sure they fit all (I'd need about 6000 per day). I've been using it but today I noticed that the next day (for example the next tuesday) it follows by the photo img6001 and so on.
I'd like it to overwrite the files of the past day of the week, like the {X} option but in increasing order (the higher the number, the last photo).
Does anyone know how could I achieve that?
Hope you understand me, thanks.
grar
 
Posts: 11
Joined: Tue Feb 28, 2012 6:03 pm

Advertisement

Postby memoric » Tue Feb 28, 2012 8:47 pm

Maybe you can write a script which would delete next day's folder (if it exists)
& schedule it to run, let's say, before midnight?
M3m0RiC RuL3z!
Image
memoric
 
Posts: 185
Joined: Wed Feb 23, 2011 1:37 pm
Location: Greece

Postby grar » Tue Feb 28, 2012 10:04 pm

I've been looking about that. It is an old winxp and I couldn't find the scheduler.
I think that this is the best idea, but I haven't done batch scripts. I suppose I could write a program or look for something existing.
Do you know how is the scheduler named?
grar
 
Posts: 11
Joined: Tue Feb 28, 2012 6:03 pm

Postby grar » Wed Feb 29, 2012 1:23 am

I found a program that seems to do what I want, but I went on and tried to script a bash to do the work. I think I have it now, I'll try it these days.
Thanks a lot for your help!
grar
 
Posts: 11
Joined: Tue Feb 28, 2012 6:03 pm

Postby memoric » Wed Feb 29, 2012 1:54 am

Sure, np. Just be careful if you decide to download a ready script. ;) If you
still want one, I think I have something similar that I could adapt for you.
M3m0RiC RuL3z!
Image
memoric
 
Posts: 185
Joined: Wed Feb 23, 2011 1:37 pm
Location: Greece

Postby grar » Wed Feb 29, 2012 2:09 am

I've done one, It has been a little hard to find a way of having the current week day, but finally I think I got it. The other thing is that I'm from Spain and here Wednesday it's miércoles and saturday it's sábado, and I had some problems handling with that accents.
I've first made a script to DIR the different folders and it seem it works. Now I have to wait for the task scheduler to run it and see if it ereases the files or not or what happens.

If you want, I can copy here the script so it may be useful for anyone in a similar situation.
grar
 
Posts: 11
Joined: Tue Feb 28, 2012 6:03 pm

Postby memoric » Wed Feb 29, 2012 11:13 pm

Why did you have problems with the accents? Which (programing) language
did you use? Is your OS non-Spanish?
Also yes, I'd like to see your script. I may have a use for it in the future now
that I started using dropbox too (thanks to you, I didn't know it before ;)).
M3m0RiC RuL3z!
Image
memoric
 
Posts: 185
Joined: Wed Feb 23, 2011 1:37 pm
Location: Greece

Auto deleting files in date folders batch script

Postby grar » Wed Feb 29, 2012 11:53 pm

Well Dropbox is a great program! I'm glad to make you know it!
I did the script in batch.
I had problems with the accents because of coding issues. I'm not sure what encoding uses, but I found in a forum how to 'know' the way to put it.

Here's the script:

Code: Select all
@echo off
for /f "tokens=1 delims=, " %%b in ('date /t') do set CURR=%%b
::Print the 3letter day
::echo %CURR%

set MIERC=mi‚
set SAB=s b


IF %CURR%==lun set DAY=2
IF %CURR%==mar set DAY=3
IF %CURR%==%MIERC% set DAY=4
IF %CURR%==jue set DAY=5
IF %CURR%==vie set DAY=6
IF %CURR%==%SAB% set DAY=7
IF %CURR%==dom set DAY=1

for /f "tokens=%DAY%" %%a in ('echo Monday Tuesday Wednesday Thursday Friday Saturday Sunday') do set G=%%a

::Print the full day
::echo %G%
del /q "C:\Documents and Settings\user\Mis documentos\Dropbox\"%G%"\*.jpg"


I'll explain it a little:
- First I needed to change the region & time settings because the time command wasn't telling me the day in words (it only said 29/02/2012)
- About the accents, you can see that mié it's in a var with value mi, (so , equals é). I found it simply typing in the console copy con file.txt and then all the á é í ó ú Á É... and copying the correct character (I don't know why the á is invisible, but it seem it works, I'll see on saturday). I don't know what is the exact issue with that accents, but the IF didn't match that way, I tried saving the .bat in ANSI, UTF8 and some others but it didn't work. But it doesn't surprise me, I've already had problems with accents in C++ before.

And well the script takes the 3 letter day name from the date command (it's separated with a comma in my case) and then it sets the var DAY with the number of the next day (to delete the next day photos). I could set that var directly to the day name, but I already had the loop and well I used it to 'translate' the number to the day that YawCam uses for the {day} format.
Then it simply does the del command in the folder where all the photos are. I use a folder for every day, to store the photos during a week.

Well, I'll see in a few moments if the first scheduled run works or not.
I hope it can help someone, I think it'll do the job for me and I've learned a little batch (I don't know if I'll use it anymore, but it's nice to learn new things :) )

edit: It seem it works. I've had some problems with the task manager but well, I think it's working now! (i'll have to wait for tomorrow to be sure if the scheduler is working :( )
grar
 
Posts: 11
Joined: Tue Feb 28, 2012 6:03 pm

Re: Auto deleting files in date folders batch script

Postby memoric » Thu Mar 01, 2012 8:33 pm

Well done grar. It looks ok, I guess it's up to the scheduler now to do its thing.
Yes, dropbox looks cool. You know, if you had sent me an invitation you'd have
got 250MB more free space (just saying, in case you didn't know, for future
references).
grar wrote:...I don't know why the á is invisible, but it seem it works...

We use "a" with accent in Greek too (ά-Ά) & the weird thing is that it's invisible
to me too!
M3m0RiC RuL3z!
Image
memoric
 
Posts: 185
Joined: Wed Feb 23, 2011 1:37 pm
Location: Greece

Postby grar » Thu Mar 01, 2012 8:46 pm

Well yesterday I could make it run automatically, but it had some access to the user problems and well, I'll see today if it runs as expected! I'm having lots of troubles with that 'server', today the failed to auto detect ip issue, the other day it simply shutted down (it's an old pc, I'm surprised of how is it lasting), that thing on the script... but well now I have it almost working 'perfectly':).
And yes it's quite strange that invisible characters, but they seem to work (yesterday was mié and it worked I think) so we'll see tomorrow with sáb.

About Dropbox, I already knew that thing of the 250MB (actually I would recieved 500MB, because I registered the .edu mail address from the university, see www.dropbox.com/edu and also /free for promos like that). They do games and things to win extra space. I though that I could have invited you when you said you started a dropbox account but I was late then!
grar
 
Posts: 11
Joined: Tue Feb 28, 2012 6:03 pm

Postby memoric » Sun Mar 04, 2012 12:49 am

grar wrote:I though that I could have invited you when you said
you started a dropbox account but I was late then!

& I found that out afterwards. :( I checked /free too & I got some more, tnx.
Anyway, how did you do with your script? Did it work for Sάbato? :wink:
M3m0RiC RuL3z!
Image
memoric
 
Posts: 185
Joined: Wed Feb 23, 2011 1:37 pm
Location: Greece

Postby grar » Sun Mar 04, 2012 1:04 am

I had the same issue when I firstly signed into dropbox. One friend talked me about that and I looked it for myself, I signed up and sent him an email saying "I made a dropbox account!", and he replied me why I didn't said him nothing! jeje

Yes! It seems it works fine now! Sábado worked fine so now I guess that everything is working alone!
grar
 
Posts: 11
Joined: Tue Feb 28, 2012 6:03 pm


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest