Copy file from a remote server to a shared drive - database-connection

I have seen many people talk about copying a file from a remote server to their local drive but I would like to copy a file from the remote server to another folder on the remote server or to my shared drive.
I am trying to develop a Python GUI to migrate databases in Windows and I would like to be able to copy some of the databases to different locations.
I have tried shutil, xcopy and scp but none of these work. I always get errors like the "path does not exist" or "invalid drive specification".
Basically, I connect to the remote server using pyodbc in the following form:
connection = pyodbc.connect("DRIVER={SQL Server Native Client 10.0};SERVER=#servername;DATABASE=stage;UID=#myuserid;Trusted_Connection=yes").
Once I have connected to server I define the two file paths as variables and then I call the xcopy function:
os.system ("""xcopy "%s" "%s" """ % (copy_path, paste_path)).
Of course I do all of this after importing pyodbc, os, and sys libraries into python. The file does not copy whether I try to paste to a folder on the same server I connect to or my shared drive.
The xcopy only works when I try to copy files from my local to a remote server or vice versa. What I want to know is whether it is possible to copy a file from one spot on my remote server to another using Python.
For example if I remote connect to my remote server and run an xcopy on the following path on the server xcopy "F:\backup\dev\audit.bak" "F:\backup\test" I get the error "invalid drive specification 0 Files copied". I look at the directory tree but the moment I try a backup or a copy it gives me an error.

Related

Not able to access External server from inside container

I am running a docker window container which is running a window service . It is trying to load a file from On-Premise file server. I have tried to map the file server path inside container using "net use" command with different credentials who have access to the file server path. After that I have used "CMDKEY" commands to authenticate the file server. I am able to do that but while application is running it is not able to access that file. I am getting access denied error. Can anyone help me on this?
For more information, I have run the IIS as well to keep container alive.
Net Use command:
Net use * "" /user:<username> /p:yes
CMDKey command
cmd.exe /C "cmdkey /add: /user:<username> /pass:"
While doing the same thing with Console Application, I am able to access the file server path from inside container but not working for window service.

TFS (On-premises) - Deploy: Windows Machine File Copy

My question is - to copy files to remote machines from the Drop folder, do I need that remote machine registered as an agent?
My remote machine is in the same network but still, I'm getting an ERROR to copy files.
No, it is not required to have a TFS Agent on the target server in order to copy files over to it, but you do need to have permission to write to it. See the screenshot of what I did. Notice that I am storing the credentials as variables in the build definition. The password is "locked" so no one can see the clear text password. I have the Build Agent running under the same service account that has Admin privileges on the target server, but leaving them off did not help. To test this out, try to log into the build server via RDP and then try to open file explorer and connect to the Target Server using the network path (\SomeServer\C$\SomePath\dir) and using the credentails (domain\login or just login) and see if it works, along with the password.

Importing CSV file in Neo4j Linux Server

I have installed Neo4j Enterprise edition 3.3.0 in my Linux server machine.
Now i am trying to access the server through my windows machine using port 7474, xx.xx.xx.xx:7474
But the problem is whenever i want to import any csv file to the database, first i have to upload the file into the "import" directory in the Linux server.
Is there any way i can directly import the file which is in my local windows machine into the Neo4j database without having to upload the file into the Linux server first?
Can I create more than one database? If yes how?
Thanks.
There is no way to do it in Neo4j, the execution of the query is done on the server side, so the url of the CSV file is related to the server.
But you can have a shared folder with the server, or you can also publish your CSV file on an HTTP server.

Publishing via Visual Studio, local files not available?

I have a ASP.NET MVC4 application, running with VS2010. I am publishing using the "Build > Publish" command and accessing it through my LAN.
This works OK and the website loads. However, whenever the website tries to call directories stored on my local drive, it cannot find them. So if it tries to open the absolute path:
C:\myFolder\
..it says it does not exist when accessed via LAN, even though it works OK when I run it locally. I tried adding that folder to the VS2010 project and republishing, with the path set "\myFolder\", but the proble persists, getting error code:
directory 'c:\windows\system32\inetsrv\myFolder\' does not exist
Maybe you should use relative paths and deploy these within the website folder ? (using App_Data if needed)
How can you be sure the C:\ drive will be available on the server with the corrects files ?

Remote SubversionSVN connection to Unix Server

Having installed TurtoiseSVN locally (local repository, no server) for my Delphi projects, i now want to share my updates via internet. To make it possible i did install Subversion (version 1.6) on an Apache Unix server (RedHat, VDS Hosting plan with Sphera) and created a repository folder at that place. The server is running well but i'm a bit lost at that point:
What are my best options to import the projects to the Unix repository, the easiest will be to clone the local repository to the one on the Unix machine? - ideally i would like them both synchro. What is the best tool to manage the Unix Subversion server and its repository (right now i'm using SSH Explorer) and best tool to checkout/import/export files on the repository of that server?
Tx
To copy the local repository to the server, you can use svnadmin dump to backup the local repo including all revisions to a portable backup file. On the target server, use svnadmin load to install the backup.
See 'Repository Maintenance - Migrating Repository Data Elsewhere' in the documentation.
If you have the server running, there is no need for the local repository anymore. If you really want to keep and synchronize a local repository with the server, you can use the svnadmin hotcopy command.
I have found a solution to my problem.
General remote connection script from a Windows SubversionSVN to a unix Subversion server:
svn+ssh://<username>#<hostname>:<port>/<location of the SVN repository>
Better, lets have username and password parameters added to TortoisePlink.exe, Open Explorer file window, right-click in the file section (get a pop-up), choose: TortoiseSVN -> Settings -> "Network" Pane-> SSH Client.
exemple: 'TortoiseSVN\bin\TortoisePlink.exe -l username -pw password'
now the connection will be:
svn+ssh://#<hostname>:<port>/<location of the SVN repository> ... no need to add username and no password asked for.

Resources