How can I automatically upload code changes on a remote VM
My current works involves working on scripts running on a Ubuntu VM.
For multiple reasons, I'm editing and committing project files on a local computer running Windows, and running them on a remote server through a SSH connection (using MobaXTerm). My build process when developing is roughly as follows:
Write the changes in my local text editor.
Open the right directory in MobaXTerm's SFTP UI.
Click "Upload file", and select the right directory and file in the Windows file browser.
Run
systemctl restart apache2.service
or whatever I need on the VM.
(obviously the build process for production builds is much more thorough and automatized)
Steps 2 and 3 feel pretty redundant. They're repetitive, easy to forget, easy to get wrong, and I'm generally giving the computer information it should know better than me.
Is there a standardized, safe way to automatically synchronize a local folder with a remote SSH folder from Windows?
Essentially, what I want is some utility that goes File myDirectory/foo/bar/X
has changed! Uploading file X to someUrl/theirDirectory/foo/bar/X
with minimum configuring.
ssh virtual-machine sync sftp
add a comment |
My current works involves working on scripts running on a Ubuntu VM.
For multiple reasons, I'm editing and committing project files on a local computer running Windows, and running them on a remote server through a SSH connection (using MobaXTerm). My build process when developing is roughly as follows:
Write the changes in my local text editor.
Open the right directory in MobaXTerm's SFTP UI.
Click "Upload file", and select the right directory and file in the Windows file browser.
Run
systemctl restart apache2.service
or whatever I need on the VM.
(obviously the build process for production builds is much more thorough and automatized)
Steps 2 and 3 feel pretty redundant. They're repetitive, easy to forget, easy to get wrong, and I'm generally giving the computer information it should know better than me.
Is there a standardized, safe way to automatically synchronize a local folder with a remote SSH folder from Windows?
Essentially, what I want is some utility that goes File myDirectory/foo/bar/X
has changed! Uploading file X to someUrl/theirDirectory/foo/bar/X
with minimum configuring.
ssh virtual-machine sync sftp
add a comment |
My current works involves working on scripts running on a Ubuntu VM.
For multiple reasons, I'm editing and committing project files on a local computer running Windows, and running them on a remote server through a SSH connection (using MobaXTerm). My build process when developing is roughly as follows:
Write the changes in my local text editor.
Open the right directory in MobaXTerm's SFTP UI.
Click "Upload file", and select the right directory and file in the Windows file browser.
Run
systemctl restart apache2.service
or whatever I need on the VM.
(obviously the build process for production builds is much more thorough and automatized)
Steps 2 and 3 feel pretty redundant. They're repetitive, easy to forget, easy to get wrong, and I'm generally giving the computer information it should know better than me.
Is there a standardized, safe way to automatically synchronize a local folder with a remote SSH folder from Windows?
Essentially, what I want is some utility that goes File myDirectory/foo/bar/X
has changed! Uploading file X to someUrl/theirDirectory/foo/bar/X
with minimum configuring.
ssh virtual-machine sync sftp
My current works involves working on scripts running on a Ubuntu VM.
For multiple reasons, I'm editing and committing project files on a local computer running Windows, and running them on a remote server through a SSH connection (using MobaXTerm). My build process when developing is roughly as follows:
Write the changes in my local text editor.
Open the right directory in MobaXTerm's SFTP UI.
Click "Upload file", and select the right directory and file in the Windows file browser.
Run
systemctl restart apache2.service
or whatever I need on the VM.
(obviously the build process for production builds is much more thorough and automatized)
Steps 2 and 3 feel pretty redundant. They're repetitive, easy to forget, easy to get wrong, and I'm generally giving the computer information it should know better than me.
Is there a standardized, safe way to automatically synchronize a local folder with a remote SSH folder from Windows?
Essentially, what I want is some utility that goes File myDirectory/foo/bar/X
has changed! Uploading file X to someUrl/theirDirectory/foo/bar/X
with minimum configuring.
ssh virtual-machine sync sftp
ssh virtual-machine sync sftp
asked Dec 19 '18 at 10:58
Narrateur du chaosNarrateur du chaos
112
112
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
There is no "standardized way".
You have these options:
- Use a tool that can watch for changes in a local directory and reflect them on a remote SFTP directory.
- Schedule a frequent synchronization of a local folder against a remote folder.
- There are (commercial) tools that can map a remote SFTP folder to a local drive. Using these you can directly work with/edit remote files using any local application.
- Some editors allow direct editing of files on an SFTP server.
You can implement the first two options with WinSCP SFTP client.
Watching for changes
Use "Keep remote directory up to date" function of WinSCP.
It can be used both in command-line/console mode using the keepuptodate
command, like:
winscp.com /ini=nul /log=c:writablepathtosynchronize.log /command ^
"open sftp://username:password@example.com/" ^
"keepuptodate C:localpath /remote/path" ^
"exit"
Or in a graphical/GUI mode. You can launch the graphical mode in WinSCP GUI (after logging in) or from a command-line using the /keepuptodate
switch like:
winscp.exe sftp://username:password@example.com/ /keepuptodate C:localpath /remote/path
Scheduling
To synchronize changes in a local directory to a remote directory, use the WinSCP synchronize
script command from a batch file like:
winscp.com /ini=nul /log=c:writablepathtosynchronize.log /command ^
"open sftp://username:password@example.com/" ^
"synchronize remote C:localpath /remote/path" ^
"exit"
And schedule the batch file to be run frequently using Windows scheduler.
For details see also a guide to automating file transfers (or synchronization) to SFTP server.
(I'm the author of WinSCP)
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1385879%2fhow-can-i-automatically-upload-code-changes-on-a-remote-vm%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
There is no "standardized way".
You have these options:
- Use a tool that can watch for changes in a local directory and reflect them on a remote SFTP directory.
- Schedule a frequent synchronization of a local folder against a remote folder.
- There are (commercial) tools that can map a remote SFTP folder to a local drive. Using these you can directly work with/edit remote files using any local application.
- Some editors allow direct editing of files on an SFTP server.
You can implement the first two options with WinSCP SFTP client.
Watching for changes
Use "Keep remote directory up to date" function of WinSCP.
It can be used both in command-line/console mode using the keepuptodate
command, like:
winscp.com /ini=nul /log=c:writablepathtosynchronize.log /command ^
"open sftp://username:password@example.com/" ^
"keepuptodate C:localpath /remote/path" ^
"exit"
Or in a graphical/GUI mode. You can launch the graphical mode in WinSCP GUI (after logging in) or from a command-line using the /keepuptodate
switch like:
winscp.exe sftp://username:password@example.com/ /keepuptodate C:localpath /remote/path
Scheduling
To synchronize changes in a local directory to a remote directory, use the WinSCP synchronize
script command from a batch file like:
winscp.com /ini=nul /log=c:writablepathtosynchronize.log /command ^
"open sftp://username:password@example.com/" ^
"synchronize remote C:localpath /remote/path" ^
"exit"
And schedule the batch file to be run frequently using Windows scheduler.
For details see also a guide to automating file transfers (or synchronization) to SFTP server.
(I'm the author of WinSCP)
add a comment |
There is no "standardized way".
You have these options:
- Use a tool that can watch for changes in a local directory and reflect them on a remote SFTP directory.
- Schedule a frequent synchronization of a local folder against a remote folder.
- There are (commercial) tools that can map a remote SFTP folder to a local drive. Using these you can directly work with/edit remote files using any local application.
- Some editors allow direct editing of files on an SFTP server.
You can implement the first two options with WinSCP SFTP client.
Watching for changes
Use "Keep remote directory up to date" function of WinSCP.
It can be used both in command-line/console mode using the keepuptodate
command, like:
winscp.com /ini=nul /log=c:writablepathtosynchronize.log /command ^
"open sftp://username:password@example.com/" ^
"keepuptodate C:localpath /remote/path" ^
"exit"
Or in a graphical/GUI mode. You can launch the graphical mode in WinSCP GUI (after logging in) or from a command-line using the /keepuptodate
switch like:
winscp.exe sftp://username:password@example.com/ /keepuptodate C:localpath /remote/path
Scheduling
To synchronize changes in a local directory to a remote directory, use the WinSCP synchronize
script command from a batch file like:
winscp.com /ini=nul /log=c:writablepathtosynchronize.log /command ^
"open sftp://username:password@example.com/" ^
"synchronize remote C:localpath /remote/path" ^
"exit"
And schedule the batch file to be run frequently using Windows scheduler.
For details see also a guide to automating file transfers (or synchronization) to SFTP server.
(I'm the author of WinSCP)
add a comment |
There is no "standardized way".
You have these options:
- Use a tool that can watch for changes in a local directory and reflect them on a remote SFTP directory.
- Schedule a frequent synchronization of a local folder against a remote folder.
- There are (commercial) tools that can map a remote SFTP folder to a local drive. Using these you can directly work with/edit remote files using any local application.
- Some editors allow direct editing of files on an SFTP server.
You can implement the first two options with WinSCP SFTP client.
Watching for changes
Use "Keep remote directory up to date" function of WinSCP.
It can be used both in command-line/console mode using the keepuptodate
command, like:
winscp.com /ini=nul /log=c:writablepathtosynchronize.log /command ^
"open sftp://username:password@example.com/" ^
"keepuptodate C:localpath /remote/path" ^
"exit"
Or in a graphical/GUI mode. You can launch the graphical mode in WinSCP GUI (after logging in) or from a command-line using the /keepuptodate
switch like:
winscp.exe sftp://username:password@example.com/ /keepuptodate C:localpath /remote/path
Scheduling
To synchronize changes in a local directory to a remote directory, use the WinSCP synchronize
script command from a batch file like:
winscp.com /ini=nul /log=c:writablepathtosynchronize.log /command ^
"open sftp://username:password@example.com/" ^
"synchronize remote C:localpath /remote/path" ^
"exit"
And schedule the batch file to be run frequently using Windows scheduler.
For details see also a guide to automating file transfers (or synchronization) to SFTP server.
(I'm the author of WinSCP)
There is no "standardized way".
You have these options:
- Use a tool that can watch for changes in a local directory and reflect them on a remote SFTP directory.
- Schedule a frequent synchronization of a local folder against a remote folder.
- There are (commercial) tools that can map a remote SFTP folder to a local drive. Using these you can directly work with/edit remote files using any local application.
- Some editors allow direct editing of files on an SFTP server.
You can implement the first two options with WinSCP SFTP client.
Watching for changes
Use "Keep remote directory up to date" function of WinSCP.
It can be used both in command-line/console mode using the keepuptodate
command, like:
winscp.com /ini=nul /log=c:writablepathtosynchronize.log /command ^
"open sftp://username:password@example.com/" ^
"keepuptodate C:localpath /remote/path" ^
"exit"
Or in a graphical/GUI mode. You can launch the graphical mode in WinSCP GUI (after logging in) or from a command-line using the /keepuptodate
switch like:
winscp.exe sftp://username:password@example.com/ /keepuptodate C:localpath /remote/path
Scheduling
To synchronize changes in a local directory to a remote directory, use the WinSCP synchronize
script command from a batch file like:
winscp.com /ini=nul /log=c:writablepathtosynchronize.log /command ^
"open sftp://username:password@example.com/" ^
"synchronize remote C:localpath /remote/path" ^
"exit"
And schedule the batch file to be run frequently using Windows scheduler.
For details see also a guide to automating file transfers (or synchronization) to SFTP server.
(I'm the author of WinSCP)
answered Dec 19 '18 at 11:25
Martin PrikrylMartin Prikryl
10.9k43276
10.9k43276
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1385879%2fhow-can-i-automatically-upload-code-changes-on-a-remote-vm%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown