Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to make backup with FTP
Message
From
16/04/2012 09:50:10
 
 
To
16/04/2012 09:03:42
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01541621
Message ID:
01541635
Views:
32
My apologies. I should have given more details. At least what I can think of

Format of data. Standard DBC no SQL Server
I want to create an app. that will copy all the data (could be zipped before sending) to an FTP site

Can that be automated?

I want to schedule

>>I want to automate backups for our clients. For example late in the evening I want to start an app that will save data to a remote computer.
>>
>>I guess that this has been asked before.
>>
>>What do you suggest?
>
>If SQL, generate a script from whichever tool you use, then use that script to textmerge in Fox so you can have a filename of the backup under your control - probably containing a timestamp. Build the prg to connect and run that script into an exe, run that exe as a scheduled task. I did that 8 years ago, and AFAIK that one still works.
>
>Three caveats: the paths to where you back up have to be local to the machine on which the SQL server runs, or if on any other machine, UNCs. The script will run in SQL server, your fox app receives only a little cursor with the status in the end.
>
>Second, a scheduled task runs under someone's account; if you choose one where password may change, when it changes it will stop working, without any alarm. There will be an entry in the error log on that machine, which your users, of course, read every morning :). So pick the account wisely.
>
>Third, don't try to introduce any @ variables in the script, it won't work (at least not on SQL 2000, didn't bother to try on later). Must have literals, which is why I said textmerge.
>
>In case of dbfs, build a little prg to zip the tables (or just the whole data folder) and run it as a scheduled task.
>
>Here's what I use in one of my fun projects - but run it manually. It can surely be automated. PkZip25.exe can be downloaded from the web, it's the last free version of it. Api_apprun (in process.vcx) is a download from UT.
>
>If Not Directory("backup")
>	Md backup
>Endif
>
>lcZipFile=Transform(Ttoc(Datetime(),1),"@R 9999-99-99~99-99-99")
>
>Do closeall In startme     && this just closes all tables in all DSs
>
>TEXT textmerge noshow to lcBat
>pkzip25 -add=update backup\<<lcZipFile>>  data\*.* >zipcp.log
>ENDTEXT
>lcbatFile=Fullpath(Forceext(Sys(2015),"bat"))
>lcThere=Fullpath(".")
>Strtofile(lcBat, lcbatFile)
>Local oprocess As api_apprun Of Process.vcx
>oprocess=Newobject('api_apprun','process', '', lcbatFile, lcThere, 'HID')
>oprocess.LaunchAppAndWait
>Release oprocess
>Erase (lcbatFile)
>
>
>
>Your other option is to see with their IT stuff to schedule a backup.
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform