开发者

How to automate this process?

开发者 https://www.devze.com 2023-01-05 11:29 出处:网络
I do these jobs every day manually with a GUI client: upload data(.tar.gz) t开发者_开发知识库o remote server(linux) via ssh,which takes about an hour.

I do these jobs every day manually with a GUI client:

  1. upload data(.tar.gz) t开发者_开发知识库o remote server(linux) via ssh,which takes about an hour.
  2. uncompress the data and run update.sh

How can I automate the process so that I don't need to wait an hour?

My PC OS is windows.

How to do the above jobs by commandline?


Use the task scheduler built into Windows to get the data to the server.

http://technet.microsoft.com/en-us/library/bb726974.aspx
http://kb.helpdeskpilot.com/knowledgebase.php?act=art&article_id=67


You can do everything that you want with vbscript since you are on a Windows PC. Look into using .hta with vbscript.


This sounds like the perfect job for a batch file. A batch file is simply a list of commands to be executed by the Windows shell (cmd.exe). Once you find and install a Windows ssh client with a command-line interface (PuTTY is one possible option), simply type the commands you would use to perform your task into a text file with the extension .bat and run the batch file. See this cmd.exe tutorial for more information on the Windows shell and this batch file guide once you're comfortable on the command line. Batch files are a great way to automate tedious tasks.


Have the Linux server fetch the data, e. g. using wget. Then write a shell script that executes wget (or whatever you used to fetch the file) and then calls your update script (should be three lines). Finally create a cron job to execute the script.

It might be a bit more work than a Windoze-only-Automation, but the big advantage is that if you PC goes AWOL, the process will continue running...

0

精彩评论

暂无评论...
验证码 换一张
取 消