Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var EasyFtp = require('easy-ftp');
- var ftp = new EasyFTP();
- var config = {
- host: '',
- port: 21,
- username: '',
- password: ''
- };
- ftp.connect(config);
- var filesFrom=['/file1.txt','/anotherFile.txt','/moreFiles.txt','/a.txt','/x.txt']
- var filesTo=['/archived/file1.txt','/archived/anotherFile.txt','/archived/moreFiles.txt','/archived/a.txt','/archived/x.txt']
- for (var i = 0; i < filesFrom.length; i++) {
- ftp.mv(filesFrom[i], filesTo[i], function(err, newPath){
- if (err) { console.log(err) }
- });
- };
- ftp.close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement