File Dates

General Macro Scheduler discussion

Moderators: JRL, Dorian (MJT support)

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue May 10, 2005 8:39 pm

I don't see the FTP command in your log file, was from earlier test?

Since you cannot see on Server, then I wonder if FTP line is correct. Would be good to see content from log file. You can edit login name and password with dummy data before submitting here for review.

Although %variable% symbols are not always needed, I usually use the %symbols% anyway because then I can see the actual value in the log file, else I only see the variablename and errors are not so obvious.

Example lines:

Let>k=%k%+1

Until>%k%,%file_names_count%
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

macrunning
Pro Scripter
Posts: 68
Joined: Wed May 04, 2005 10:24 pm

Code Review

Post by macrunning » Tue May 10, 2005 9:03 pm

Here is my most recent script for this:

Let>path=C:\Program Files\Apache Group\Apache\htdocs\fordofkirkland\

GetFileList>%path%test\*.*,files

Separate>files,;,file_names

Day>the_day

Month>the_month

Year>the_year

Let>k=0

Repeat>k

Let>k=k+1

//Get the date of the file

FileDate>file_names_%k%,fdate

if>fdate=%the_year%%the_month%%the_day%

//FileDate matches today's date, local_file is current file

Let>local_file=file_names_%k%

//remove path from local_file to get remote file name

StringReplace>local_file,path,,remote_file

//ftp the file, modify next line for server,user,pass, remote directory, txfer mode
FTP_STATUS>1
FTP_PASSIVE>1
FTPPutFile>host,username,password,21,local_file,/public_html/test/%remote_file%,I

endif

Until>k,file_names_count
End

macrunning
Pro Scripter
Posts: 68
Joined: Wed May 04, 2005 10:24 pm

Variables

Post by macrunning » Tue May 10, 2005 9:05 pm

I will work on getting in the habbit of using the % symbols for variables. I already posted part of my log file. See earlier in this post.

macrunning
Pro Scripter
Posts: 68
Joined: Wed May 04, 2005 10:24 pm

Post by macrunning » Tue May 10, 2005 9:06 pm

I mixed up the server host. Let me give it another shot. I told you my brain is small. Be back to let you know if it worked with the correct host name.

macrunning
Pro Scripter
Posts: 68
Joined: Wed May 04, 2005 10:24 pm

All Hail BOB HANSEn

Post by macrunning » Tue May 10, 2005 9:11 pm

Hey Bob and Support team thanx for your help on this matter. My brain is small so please forgive me for all the blabbering today. I've got the pics to upload, of course I've somehow managed to append test\ at the beginning of each file but I'll hopefully figure this one out on my own.

macrunning
Pro Scripter
Posts: 68
Joined: Wed May 04, 2005 10:24 pm

We can close the book on this one

Post by macrunning » Tue May 10, 2005 9:45 pm

Ok finally got it working. I wasted most of the day on this but the way I figure it is that this will help save about 20 minutes a day. Now multiply that by 5 days a week 50 weeks out of the year and thats a lot of time save.

One thing to note is in the original code support put up for me they had the following:
GetFileList>%path%photos*.*,files

This appended the word 'photos' to the file name and wasn't actually what I was looking for. But other than that everything worked out. Thanks again everyone.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts