Any windows command line guru's on here? Need help.

Any windows command line guru's on here? Need help.

Author
Discussion

Philemon

1,624 posts

196 months

Tuesday 28th July 2015
quotequote all
All things being considered, why don't you go to their dedicated forum and ask one of their "gurus" what they suggest, since this must be a recurrent issue, not unique to your application?

LeeThr

Original Poster:

3,122 posts

171 months

Tuesday 28th July 2015
quotequote all
Philemon said:
All things being considered, why don't you go to their dedicated forum and ask one of their "gurus" what they suggest, since this must be a recurrent issue, not unique to your application?
I work for the company that develops Ffenics, and the head developer is the one that told me that copying & pasting or archiving is fine. When he's done it manually in the past he's simply gone into computer management and closed the open shared files. Which is what I need to be able to do via the command line.

snowy

541 posts

281 months

Tuesday 28th July 2015
quotequote all
If the database engine runs as a windows service, stop the service(s) that would remove any locks on open files, after the folder has been copied, restart the service


LeeThr

Original Poster:

3,122 posts

171 months

Tuesday 28th July 2015
quotequote all
snowy said:
If the database engine runs as a windows service, stop the service(s) that would remove any locks on open files, after the folder has been copied, restart the service
Unfortunately there are no services to stop.

djfaulkner

1,103 posts

218 months

Tuesday 28th July 2015
quotequote all
LeeThr said:
I work for the company that develops Ffenics, and the head developer is the one that told me that copying & pasting or archiving is fine. When he's done it manually in the past he's simply gone into computer management and closed the open shared files. Which is what I need to be able to do via the command line.
Have you tried using the net files command?
https://technet.microsoft.com/en-us/library/bb4907...

You can use it to list the open files and then force them, there is a bit more information here
http://www.techrepublic.com/article/find-open-file...

Maybe schedule a task to list the open files just before the backup over a period of time, as it might the same people keeping the files open.




gowmonster

2,471 posts

167 months

Tuesday 28th July 2015
quotequote all
it sounds worse that MSAccess frown

LeeThr

Original Poster:

3,122 posts

171 months

Tuesday 28th July 2015
quotequote all
anonymous said:
[redacted]
Our head developer, is actually the former head developer of DataEase. The product in itself does work very well. It's just this backup issue really.

The issue is on a customers site to which we only have access to one PC, and as stated shutting down everything else just isn't an option.

maffski

1,868 posts

159 months

Tuesday 28th July 2015
quotequote all
RoboCopy + ShadowSpawn

ShadowSpawn will create a copy of a folder using VSS (which can cope with locked files) and then mount it as a drive, you can then RoboCopy / WinZip whatever the contents of this drive.

You need to be sure that there aren't any users actively working (e.g. VPN home workers, sales guys in another time zone) as I wouldn't know if Ffenics has any kind of transaction management so you could end up with a ShadowCopy taken when some files had just been updated but not others.

Chances are you will have no way of controlling this, so will just have to take the customers word for it when they say no one will ever be working at that time.



TurricanII

1,516 posts

198 months

Tuesday 28th July 2015
quotequote all
I would buy a cheap backup program that is capable of mouting a VSS/Shadow Copy as previously recommended. Closing files as you are doing is just as bad as cutting users off, so the database can probably survive being backed up by a Shadow Copy. As you have the head developer on tap, they should be able to advise..

If the files are in one shared folder, you can alternatively unshare the folder at the command line before the backup:

NET SHARE {sharename | devicename | drivetongue outath} /DELETE

..and re-share it afterwards in the batch file, taking care to insert the correct share permissions using the /GRANT parameter:

NET SHARE sharename=drivetongue outath /REMARK:"text" [/CACHE:Manual | Automatic | No ]

This may however cause some users to see a red X on their network drive until they double click it again.


Jakg

3,463 posts

168 months

Tuesday 28th July 2015
quotequote all
To put another spin on it - you don't need to do a copy (ignoring all the discussion above!), you can just zip it up in place using something like 7Zip - you can give it all kinds of useful arguments, including -ssw - http://sevenzip.osdn.jp/chm/cmdline/switches/share...

Then you just need to run something to copy it to the FTP server.

LeeThr

Original Poster:

3,122 posts

171 months

Tuesday 28th July 2015
quotequote all
Robocopy seems to have done the trick, I modified my batch file to use robocopy to copy the directory from the server on to the work station we have access to, which was then archived successfully with no warnings about any files in use etc. And successfully uploaded to our FTP site.

R8VXF

6,788 posts

115 months

Tuesday 28th July 2015
quotequote all
You really should press your lead dev to include some sort of backup into the programme though. Pretty flunking useless without it. Also, there seems to be no ACID compliance in his "database" from what I can see...

Nuclear Biscuit

375 posts

201 months

Tuesday 28th July 2015
quotequote all
As others have said, have you tried retoring from a backup? They're not a lot of use if you can't.

gowmonster

2,471 posts

167 months

Tuesday 28th July 2015
quotequote all
test the backups on a weekly basis!!!!

cornet

1,469 posts

158 months

Tuesday 28th July 2015
quotequote all
Hummm just caught up with this thread - could it be that opportunistic locking is enabled on the client and server so the file is being locked even when it's not actually being used.

I doubt Ffenics actually requires oplocks since it will have its own internal shared lock but best to check with the developer.

See here for an explanation and how to disable them : http://www.dataaccess.com/whitepapers/opportunlock...

R8VXF

6,788 posts

115 months

Tuesday 28th July 2015
quotequote all
cornet said:
Hummm just caught up with this thread - could it be that opportunistic locking is enabled on the client and server so the file is being locked even when it's not actually being used.

I doubt Ffenics actually requires oplocks since it will have its own internal shared lock but best to check with the developer.

See here for an explanation and how to disable them : http://www.dataaccess.com/whitepapers/opportunlock...
The app devs probably haven't even thought about this tbh, one of the worst culprits in my experience is excel, it fks ssis up on a regular basis by holding a session lock and denying access.

LeeThr

Original Poster:

3,122 posts

171 months

Tuesday 28th July 2015
quotequote all
Nuclear Biscuit said:
As others have said, have you tried retoring from a backup? They're not a lot of use if you can't.
Yes we have and there's been no issues so far with any copies made.

lestag

4,614 posts

276 months

Thursday 30th July 2015
quotequote all
What OS?

ETA: is one that supports powershell
https://www.google.co.nz/search?q=powershell+close...


Edited by lestag on Thursday 30th July 12:40