
{"id":817,"date":"2011-12-26T00:45:57","date_gmt":"2011-12-26T00:45:57","guid":{"rendered":"http:\/\/congnghepc.com\/2011\/12\/26\/tu-dong-sao-luu-du-lieu-web-server-voi-winscp-qua-ftp\/"},"modified":"2011-12-26T00:45:57","modified_gmt":"2011-12-26T00:45:57","slug":"tu-dong-sao-luu-du-lieu-web-server-voi-winscp-qua-ftp","status":"publish","type":"post","link":"https:\/\/tapchicntt.com\/tu-dong-sao-luu-du-lieu-web-server-voi-winscp-qua-ftp\/","title":{"rendered":"T\u1ef1 \u0111\u1ed9ng sao l\u01b0u d\u1eef li\u1ec7u web server v\u1edbi WinSCP qua FTP"},"content":{"rendered":"<p>\n\tV\u1ec1 m\u1eb7t b\u1ea3n ch\u1ea5t, giao th\u1ee9c <strong>FTP <\/strong>&ndash; <a href=\"http:\/\/en.wikipedia.org\/wiki\/FTP\" target=\"_blank\"><span style=\"color: rgb(0, 0, 255);\">File Transfer Protocol<\/span><\/a> l&agrave; 1 h&igrave;nh th\u1ee9c truy\u1ec1n t\u1ea3i d\u1eef li\u1ec7u gi\u1eefa nhi\u1ec1u m&aacute;y t&iacute;nh kh&aacute;c nhau. \u0110\u01b0\u1ee3c h&igrave;nh th&agrave;nh v&agrave; ph&aacute;t tri\u1ec3n qua 1 th\u1eddi gian kh&aacute; d&agrave;i, <strong>FTP <\/strong>v&agrave; <strong>SFTP <\/strong>&ndash; <strong>Secure File Transfer Protocol<\/strong> v\u1eabn \u0111ang l&agrave; nh\u1eefng giao th\u1ee9c ph\u1ed5 bi\u1ebfn nh\u1ea5t hi\u1ec7n nay tr&ecirc;n th\u1ebf gi\u1edbi. \u0110\u1ec3 &aacute;p d\u1ee5ng v&agrave;o b&agrave;i th\u1eed nghi\u1ec7m d\u01b0\u1edbi \u0111&acirc;y, c&aacute;c b\u1ea1n c\u1ea7n chu\u1ea9n b\u1ecb:<\/p>\n<p>\n\t&nbsp;&#8211; <strong>Server FTP<\/strong><\/p>\n<p>\n\t&nbsp;&#8211; M&aacute;y t&iacute;nh s\u1eed d\u1ee5ng h\u1ec7 \u0111i\u1ec1u h&agrave;nh <strong>Windows<\/strong><\/p>\n<p>\n\t&nbsp;&#8211; Phi&ecirc;n b\u1ea3n <a href=\"http:\/\/winscp.net\/eng\/download.php\" target=\"_blank\"><span style=\"color: rgb(0, 0, 255);\">WinSCP <\/span><\/a>&ndash; d&agrave;nh cho <strong>Windows<\/strong><\/p>\n<h2>\n\tThi\u1ebft l\u1eadp WinSCP:<\/h2>\n<p>\n\tVi\u1ec7c \u0111\u1ea7u ti&ecirc;n ch&uacute;ng ta c\u1ea7n l&agrave;m t\u1ea1i \u0111&acirc;y l&agrave; c&agrave;i \u0111\u1eb7t <strong>WinSCP <\/strong>tr&ecirc;n m&aacute;y t&iacute;nh <strong>Windows<\/strong>:<\/p>\n<p style=\"text-align: center;\">\n\t<img decoding=\"async\" align=\"absMiddle\" alt=\"c\u00e0i WinSCP tr\u00ean Windows\" src=\"http:\/\/dl.dropbox.com\/u\/1552467\/pctips\/Tu-dong-sao-luu-du-lieu-web-server-voi-WinSCP-qua-FTP\/backupwinscp--02.jpg\" style=\"border-width: 0px; border-style: solid; width: 539px; height: 426px;\" \/><\/p>\n<p>\n\tSau \u0111&oacute;, c&aacute;c b\u1ea1n c\u1ea7n t\u1ea1o m\u1edbi 1 section profile \u0111\u1ec3 s\u1eed d\u1ee5ng trong c&aacute;c phi&ecirc;n l&agrave;m vi\u1ec7c sau n&agrave;y. T\u1ea1i m&agrave;n h&igrave;nh Login, ch&uacute;ng ta nh\u1eadp t&ecirc;n host (v&iacute; d\u1ee5 <strong>ftp.howtogeek.com<\/strong>), <strong>Username <\/strong>v&agrave; <strong>Password<\/strong>, ch\u1ecdn <strong>FTP <\/strong>ho\u1eb7c <strong>SFTP<\/strong>, thay \u0111\u1ed5i gi&aacute; tr\u1ecb <strong>Port <\/strong>ph&ugrave; h\u1ee3p. Sau \u0111&oacute; nh\u1ea5n <strong>Save <\/strong>\u0111\u1ec3 l\u01b0u profile n&agrave;y l\u1ea1i:<\/p>\n<p style=\"text-align: center;\">\n\t<img decoding=\"async\" align=\"absMiddle\" alt=\"t\u1ea1o Section Profile\" src=\"http:\/\/dl.dropbox.com\/u\/1552467\/pctips\/Tu-dong-sao-luu-du-lieu-web-server-voi-WinSCP-qua-FTP\/backupwinscp--03.jpg\" style=\"border-width: 0px; border-style: solid; width: 567px; height: 402px;\" \/><\/p>\n<h2>\n\tT\u1ea1o Script:<\/h2>\n<p>\n\tT\u1ea1i \u0111&acirc;y, ch&uacute;ng ta s\u1ebd t\u1ea1o 1 \u0111o\u1ea1n m&atilde; \u0111\u01a1n gi\u1ea3n \u0111\u1ec3 h\u1ec7 th\u1ed1ng t\u1ef1 \u0111\u0103ng nh\u1eadp v&agrave;o server <strong>FTP<\/strong>, giao ti\u1ebfp v\u1edbi <strong>WinSCP <\/strong>\u0111\u1ec3 t\u1ea3i nh\u1eefng file c&ograve;n thi\u1ebfu, sau \u0111&oacute; t\u1ea1o ti\u1ebfp file log \u0111\u1ec3 ghi l\u1ea1i to&agrave;n b\u1ed9 ho\u1ea1t \u0111\u1ed9ng c\u1ee7a <strong>FTP<\/strong>. \u0110\u1ec3 b\u1eaft \u0111\u1ea7u, c&aacute;c b\u1ea1n m\u1edf <strong>NotePad <\/strong>v&agrave; copy \u0111o\u1ea1n m&atilde; d\u01b0\u1edbi \u0111&acirc;y v&agrave;o:<\/p>\n<p>\n\t<span style=\"color: rgb(153, 51, 0);\"><em><span style=\"font-family: Courier New;\">option batch on<\/span><\/em><\/span><\/p>\n<p>\n\t<span style=\"color: rgb(153, 51, 0);\"><em><span style=\"font-family: Courier New;\">option confirm off<\/span><\/em><\/span><\/p>\n<p>\n\t<span style=\"color: rgb(153, 51, 0);\"><em><span style=\"font-family: Courier New;\">open patrickbisch@ftp.howtogeek.com<\/span><\/em><\/span><\/p>\n<p>\n\t<span style=\"color: rgb(153, 51, 0);\"><em><span style=\"font-family: Courier New;\">cd backups<\/span><\/em><\/span><\/p>\n<p>\n\t<span style=\"color: rgb(153, 51, 0);\"><em><span style=\"font-family: Courier New;\">option transfer binary<\/span><\/em><\/span><\/p>\n<p>\n\t<span style=\"color: rgb(153, 51, 0);\"><em><span style=\"font-family: Courier New;\">get \/testremote* f:backupstestlocal*<\/span><\/em><\/span><\/p>\n<p>\n\t<span style=\"color: rgb(153, 51, 0);\"><em><span style=\"font-family: Courier New;\">synchronize local f:backupstestlocal testremote<\/span><\/em><\/span><\/p>\n<p>\n\t<span style=\"color: rgb(153, 51, 0);\"><em><span style=\"font-family: Courier New;\">exit<\/span><\/em><\/span><\/p>\n<p>\n\t&nbsp;<\/p>\n<p>\n\tC\u1ee5 th\u1ec3, <strong>WinSCP <\/strong>s\u1ebd t\u1ef1 \u0111\u1ed9ng tr\u1ea3 l\u1eddi c&aacute;c th&ocirc;ng b&aacute;o c\u1ee7a h\u1ec7 th\u1ed1ng \u0111\u1ec3 tr&aacute;nh t&igrave;nh tr\u1ea1ng ng\u1eaft gi\u1eefa ch\u1eebng khi ho\u1ea1t \u0111\u1ed9ng, sau \u0111&oacute; s\u1ebd ghi \u0111&egrave; l&ecirc;n nh\u1eefng file v\u1eeba \u0111\u01b0\u1ee3c t\u1ea1o. Ti\u1ebfp t\u1ee5c, \u0111\u0103ng nh\u1eadp v&agrave;o server <strong>FTP <\/strong>d\u1ef1a v&agrave;o profile \u0111&atilde; \u0111\u01b0\u1ee3c t\u1ea1o \u1edf b&ecirc;n tr&ecirc;n, thay \u0111\u1ed5i c\u1ea5u tr&uacute;c th\u01b0 m\u1ee5c (n\u1ebfu th\u1ea5y c\u1ea7n thi\u1ebft), chuy\u1ec1n m&atilde; nh\u1ecb ph&acirc;n (tr&aacute;i ng\u01b0\u1ee3c v\u1edbi <strong>ASCII<\/strong>). Cu\u1ed1i c&ugrave;ng, \u1ee9ng d\u1ee5ng s\u1ebd l\u1ecdc s\u01a1 \u0111\u1ed3, c\u1ea5u tr&uacute;c th\u01b0 m\u1ee5c <strong>FTP <\/strong>tr&ecirc;n server remote, v&agrave; chuy\u1ec3n c&aacute;c file c\u1ea7n thi\u1ebft t\u1edbi th\u01b0 m\u1ee5c \u0111&atilde; \u0111\u01b0\u1ee3c ch\u1ec9 \u0111\u1ecbnh. C&aacute;c b\u1ea1n c&oacute; th\u1ec3 tham kh\u1ea3o th&ecirc;m t\u1ea1i <a href=\"http:\/\/winscp.net\/eng\/docs\/scripting\" target=\"_blank\"><span style=\"color: rgb(0, 0, 255);\">\u0111&acirc;y<\/span><\/a>.<\/p>\n<p>\n\tTr\u01b0\u1edbc khi ch\u1ea1y ho\u1eb7c ch\u1ec9nh s\u1eeda \u0111o\u1ea1n script n&agrave;y, c&aacute;c b\u1ea1n n&ecirc;n t\u1ea1o th\u01b0 m\u1ee5c ki\u1ec3m tra tr&ecirc;n m&aacute;y local v&agrave; remote (\u0111\u1ec3 tr&aacute;nh tr\u01b0\u1eddng h\u1ee3p nh\u1ea7m l\u1eabn c&oacute; th\u1ec3 x\u1ea3y ra). Tr&ecirc;n m&aacute;y local, ch&uacute;ng ta t\u1ea1o th\u01b0 m\u1ee5c <strong>testlocal <\/strong>(\u1edf \u0111&acirc;y l&agrave; <strong>F:backups<\/strong>) v&agrave; testremote tr&ecirc;n server <strong>FTP<\/strong>. Sau \u0111&oacute;, ch\u1ea1y script, n\u1ebfu th&agrave;nh c&ocirc;ng th&igrave; l\u01b0u \u0111o\u1ea1n m&atilde; tr&ecirc;n v&agrave;o th\u01b0 m\u1ee5c b\u1ea5t k\u1ef3 tr&ecirc;n m&aacute;y t&iacute;nh.<\/p>\n<h2>\n\tThi\u1ebft l\u1eadp ch\u1ebf \u0111\u1ed9 t\u1ef1 \u0111\u1ed9ng cho script:<\/h2>\n<p>\n\tPh\u1ea7n c&ograve;n l\u1ea1i c\u1ee7a qu&aacute; tr&igrave;nh, ch&uacute;ng ta s\u1ebd \u0111\u1ec3 cho <strong>Windows <\/strong>th\u1ef1c hi\u1ec7n &ndash; d\u1ef1a v&agrave;o t&iacute;nh n\u0103ng <strong>Task Scheduler<\/strong> c&oacute; s\u1eb5n. C&aacute;c b\u1ea1n m\u1edf <strong>Control Panel &gt; System and Security &gt; Administrative Tools &gt; Task Scheduler:<\/strong><\/p>\n<p class=\"SlideTable\" style=\"text-align: center;\">\n\t<a class=\"_lightBox\" href=\"http:\/\/www.quantrimang.com.vn\/photos\/image\/122011\/22\/backupwinscp--04.jpg\" title=\"\u1ea2nh l\u1edbn\"><img decoding=\"async\" align=\"absMiddle\" alt=\"s\u1eed d\u1ee5ng Task Scheduler\" src=\"http:\/\/dl.dropbox.com\/u\/1552467\/pctips\/Tu-dong-sao-luu-du-lieu-web-server-voi-WinSCP-qua-FTP\/backupwinscp--04.jpg\" style=\"border-width: 0px; border-style: solid; width: 640px; height: 386px;\" \/><\/a><\/p>\n<p>\n\tT\u1ea1i c\u1eeda s\u1ed5 b&ecirc;n ph\u1ea3i, nh\u1ea5n <strong>Create Basic Task:<\/strong><\/p>\n<p class=\"SlideTable\" style=\"text-align: center;\">\n\t<a class=\"_lightBox\" href=\"http:\/\/www.quantrimang.com.vn\/photos\/image\/122011\/22\/backupwinscp--05.jpg\" title=\"\u1ea2nh l\u1edbn\"><img decoding=\"async\" align=\"absMiddle\" alt=\"nh\u1ea5n Create Basic Task\" src=\"http:\/\/dl.dropbox.com\/u\/1552467\/pctips\/Tu-dong-sao-luu-du-lieu-web-server-voi-WinSCP-qua-FTP\/backupwinscp--05.jpg\" style=\"border-width: 0px; border-style: solid; width: 640px; height: 386px;\" \/><\/a><\/p>\n<p>\n\t\u0110\u1eb7t t&ecirc;n v&agrave; mi&ecirc;u t\u1ea3 ng\u1eafn g\u1ecdn cho thao t&aacute;c n&agrave;y, nh\u1ea5n <strong>Next <\/strong>\u0111\u1ec3 ti\u1ebfp t\u1ee5c:<\/p>\n<p class=\"SlideTable\" style=\"text-align: center;\">\n\t<a class=\"_lightBox\" href=\"http:\/\/www.quantrimang.com.vn\/photos\/image\/122011\/22\/backupwinscp--06.jpg\" title=\"\u1ea2nh l\u1edbn\"><img decoding=\"async\" align=\"absMiddle\" alt=\"nh\u1ea5n Next\" src=\"http:\/\/dl.dropbox.com\/u\/1552467\/pctips\/Tu-dong-sao-luu-du-lieu-web-server-voi-WinSCP-qua-FTP\/backupwinscp--06.jpg\" style=\"border-width: 0px; border-style: solid; width: 640px; height: 386px;\" \/><\/a><\/p>\n<p>\n\tT&ugrave;y ch\u1ecdn ti\u1ebfp theo l&agrave; ch\u1ebf \u0111\u1ed9 ho\u1ea1t \u0111\u1ed9ng theo th\u1eddi gian, t\u1ea1i b&agrave;i th\u1eed nghi\u1ec7m n&agrave;y, ch&uacute;ng ta mu\u1ed1n \u0111o\u1ea1n script ch\u1ea1y m\u1ed7i khi m&aacute;y t&iacute;nh kh\u1edfi \u0111\u1ed9ng. Do v\u1eady c&aacute;c b\u1ea1n ch\u1ecdn <strong>When the computer starts:<\/strong><\/p>\n<p class=\"SlideTable\" style=\"text-align: center;\">\n\t<a class=\"_lightBox\" href=\"http:\/\/www.quantrimang.com.vn\/photos\/image\/122011\/22\/backupwinscp--07.jpg\" title=\"\u1ea2nh l\u1edbn\"><img decoding=\"async\" align=\"absMiddle\" alt=\"t\u00f9y ch\u1ecdn ch\u1ebf \u0111\u1ed9 ho\u1ea1t \u0111\u1ed9ng\" src=\"http:\/\/dl.dropbox.com\/u\/1552467\/pctips\/Tu-dong-sao-luu-du-lieu-web-server-voi-WinSCP-qua-FTP\/backupwinscp--07.jpg\" style=\"border-width: 0px; border-style: solid; width: 640px; height: 386px;\" \/><\/a><\/p>\n<p>\n\tT\u1ea1i m&agrave;n h&igrave;nh ti\u1ebfp theo, ch\u1ecdn <strong>Start a program<\/strong> v&agrave; nh\u1ea5n <strong>Next<\/strong>. H\u1ec7 th\u1ed1ng s\u1ebd y&ecirc;u c\u1ea7u ch&uacute;ng ta tr\u1ecf \u0111\u01b0\u1eddng d\u1eabn t\u1edbi file c\u1ea7n th\u1ef1c thi. Nh\u1ea5n n&uacute;t Browse v&agrave; tr\u1ecf t\u1edbi <strong>C:Program FilesWinSCPWinSCP.exe<\/strong>. B&ecirc;n d\u01b0\u1edbi, c&aacute;c b\u1ea1n nh\u1eadp:<\/p>\n<p style=\"margin-left: 40px;\">\n\t<span style=\"color: rgb(153, 51, 0);\"><em><span style=\"font-family: Courier New;\">\/console \/script=f:backupsync.txt \/log=f:backuplog.txt<\/span><\/em><\/span><\/p>\n<p class=\"SlideTable\" style=\"text-align: center;\">\n\t<a class=\"_lightBox\" href=\"http:\/\/www.quantrimang.com.vn\/photos\/image\/122011\/22\/backupwinscp--08.jpg\" title=\"\u1ea2nh l\u1edbn\"><img loading=\"lazy\" decoding=\"async\" align=\"absMiddle\" alt=\"\u0111i\u1ec1n th\u00f4ng s\u1ed1 k\u1ef9 thu\u1eadt\" border=\"0\" height=\"386\" src=\"http:\/\/www.quantrimang.com.vn\/photos\/image\/122011\/22\/backupwinscp--08.jpg\" width=\"640\" \/><\/a><\/p>\n<p>\n\tSau \u0111&oacute;, h\u1ec7 th\u1ed1ng s\u1ebd hi\u1ec3n th\u1ecb \u0111\u1ea7y \u0111\u1ee7 th&ocirc;ng tin t\u1ed5ng qu&aacute;t c\u0169ng nh\u01b0 chi ti\u1ebft c\u1ee7a to&agrave;n b\u1ed9 qu&aacute; tr&igrave;nh tr&ecirc;n, ki\u1ec3m tra l\u1ea1i v&agrave; nh\u1ea5n <strong>Finish<\/strong>. V&agrave; \u0111\u1ec3 ch\u1eafc ch\u1eafn r\u1eb1ng h\u1ec7 th\u1ed1ng s\u1ebd ho\u1ea1t \u0111\u1ed9ng \u0111&uacute;ng nh\u01b0 d\u1ef1 t&iacute;nh, c&aacute;c b\u1ea1n n&ecirc;n nh\u1ea5n n&uacute;t <strong>Run <\/strong>\u0111\u1ec3 \u0111\u1ea3m b\u1ea3o kh&ocirc;ng c&ograve;n l\u1ed7i n&agrave;o ph&aacute;t sinh:<\/p>\n<p class=\"SlideTable\" style=\"text-align: center;\">\n\t<a class=\"_lightBox\" href=\"http:\/\/www.quantrimang.com.vn\/photos\/image\/122011\/22\/backupwinscp--09.jpg\" title=\"\u1ea2nh l\u1edbn\"><img decoding=\"async\" align=\"absMiddle\" alt=\"ch\u1ea1y \u0111o\u1ea1n script\" src=\"http:\/\/dl.dropbox.com\/u\/1552467\/pctips\/Tu-dong-sao-luu-du-lieu-web-server-voi-WinSCP-qua-FTP\/backupwinscp--08.jpg\" style=\"border-width: 0px; border-style: solid; width: 640px; height: 386px;\" \/><\/a><\/p>\n<p>\n\tR\u1ea5t \u0111\u01a1n gi\u1ea3n v&agrave; d\u1ec5 d&agrave;ng, ch&uacute;c c&aacute;c b\u1ea1n th&agrave;nh c&ocirc;ng!<\/p>\n","protected":false},"excerpt":{"rendered":"<p style=\"text-align: center;\">\n\t<img decoding=\"async\" align=\"absMiddle\" alt=\"t\u1ea1o Section Profile\" src=\"http:\/\/dl.dropbox.com\/u\/1552467\/pctips\/Tu-dong-sao-luu-du-lieu-web-server-voi-WinSCP-qua-FTP\/backupwinscp--03.jpg\" style=\"border-width: 0px; border-style: solid; width: 100px; height: 71px; float: left; margin-left: 5px; margin-right: 5px;\" \/><\/p>\n<p>\n\t<span style=\"color: rgb(51, 51, 51);\">\u0110\u1ed1i v\u1edbi nh\u1eefng ng\u01b0\u1eddi qu\u1ea3n tr\u1ecb h\u1ec7 th\u1ed1ng website th&igrave; vi\u1ec7c sao l\u01b0u v&agrave; ph\u1ee5c h\u1ed3i d\u1eef li\u1ec7u lu&ocirc;n ph\u1ea3i \u0111\u1eb7t \u01b0u ti&ecirc;n l&ecirc;n h&agrave;ng \u0111\u1ea7u.V&agrave; tr&ecirc;n th\u1ef1c t\u1ebf, c&oacute; r\u1ea5t nhi\u1ec1u c&aacute;ch th\u1ef1c hi\u1ec7n vi\u1ec7c n&agrave;y \u0111\u01b0\u1ee3c &aacute;p d\u1ee5ng h&agrave;ng ng&agrave;y. <\/span>Trong b&agrave;i vi\u1ebft d\u01b0\u1edbi \u0111&acirc;y, ch&uacute;ng t&ocirc;i s\u1ebd h\u01b0\u1edbng d\u1eabn c&aacute;c b\u1ea1n c&aacute;ch l&agrave;m vi\u1ec7c n&agrave;y v\u1edbi c&ocirc;ng c\u1ee5 mi\u1ec5n ph&iacute; <a href=\"http:\/\/winscp.net\/eng\/download.php\" target=\"_blank\"><span style=\"color: rgb(0, 0, 255);\">WinSCP<\/span><\/a> v&agrave; m\u1ed9t ch&uacute;t ki\u1ebfn th\u1ee9c c\u01a1 b\u1ea3n v\u1ec1 code.<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129],"tags":[],"class_list":["post-817","post","type-post","status-publish","format-standard","hentry","category-thu-thuat-mang-web"],"views":409,"_links":{"self":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts\/817","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/comments?post=817"}],"version-history":[{"count":0,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts\/817\/revisions"}],"wp:attachment":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/media?parent=817"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/categories?post=817"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/tags?post=817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}