evanplaice / node-ftpsync Goto Github PK
View Code? Open in Web Editor NEWIntelligent file syncronization over FTP
Home Page: http://evanplaice.github.io/node-ftpsync
License: MIT License
Intelligent file syncronization over FTP
Home Page: http://evanplaice.github.io/node-ftpsync
License: MIT License
This issue has been fixed in core jsftp version 2.0.0, which needs to be updated in node-ftpsync.
Readme.md specifies "localRoot" as settings option, pretty sure this is meant to be "local"? Same with "remoteRoot", should be "remote"?
Hi there,
I really like this plugin because it only syncs the necessary files to my production server.
However I'm running into an issue which is quit a common workflow in my opinion;
When I'm done testing locally I run my npm run upload:production
task in webpack, which first runs npm run build
and after that my ftpsync
task. During the build task, my assets get recompiled into my dist folder with new hashtags in the filenames. These new filenames are saved in a assets.json file in the dist folder.
Based on this assets.json file, the correct stylesheet and javascript files etc are enqueued on my front-end. This all works great, accept since this assets.json file doesn't change in filesize, it doesn't get synced to the server, resulting in a broken front-end...
My question, should I be looking at a different ftp app or is there someway I can trick node-ftpsync to always upload this assets.json file?
Thanks a lot!
I'd like to keep a folder on my client (where the nodejs app sits) and use a readonly FTP connection to a remote server folder. I want the remote folder to be the master and the node app just keeps the local copy up to date with the remote one.
Is this possible with this library as it seems to work the opposite way from my understanding.
when I use new
keyword to create a ftpsync object , I get an error.
so , I don't use that way to get a ftpsync object,and let my object equal the ftpsync
required from your module.
but when I use the ftpsync.run
, It goes on to commit
function, I get an error as below:
events.js:72
throw er; // Unhandled 'error' event
^
Error: write ECONNRESET
at errnoException (net.js:901:11)
at Object.afterWrite (net.js:718:19)
and I can't solve the problem , can you give me some idea? @evanplaice
Hi,
I get the below error when I sync with a remote server.
MKDIR failed.
MKDIRs failed.
Commit failed.
I thought it might be permission issues but I connected using ftp with the same userid and password and I was able to create directories and remove directories. When I enable verbose logging, it lists the files in the remote directory.
What could be the issue here, and how do I go about troubleshot and fix?
Thank you,
Joseph
Howdy!
I've been digging through your library to see if I can add FTP remote>local synchronization (pull, or whatever you want to call it), and discovered a bug which causes walkRemote to only find directories.
You are checking file.type to see if you have a file or directory (lines 389 and 401), but the check for a file (file.type == 2) is incorrect.
An object from jsftp.ls will have type 0 if it's a file, 1 if it's a directory.
Installing via npm has a syntax error on line 218 of lib/ftpsync.js (seems to be fixed in the master branch of repo).
To reproduce:
Set 'connections': '2'
in config.json before running the sync.
Setting the settings.connections
variable to >1 causes uploads to fail.
Is this a limitation of the ftp server or jsftp?
Should this option be removed?
It would be beneficial of the sync could push multiple concurrent connections. 2 should be the typical limit.
I tried ftpsync the first time today, without success. This is my config file:
{
"local":".",
"remote":"/FGE/v2/",
"host":"www.kk-eppstein.de",
"port":21,
"user":"www.kk-eppstein.de",
"pass":"***",
"connections":"2",
"ignore":[
".scripts", "scss", "bower_components",
"Bilder", "bower.json", "Gruntfile.js",
"node_modules", "package.json", "README.md",
"run.sh", "Dockerfile", "config.json"
]
}
And I get this error running ftpsync:
$ ftpsync
Setup
Setup complete.
Collecting
Collection complete.
Consolidating
Consolidation complete.
Committing
/usr/local/lib/node_modules/ftpsync/lib/ftpsync.js:218
sync.info('MKDIRs complete.');
^
TypeError: Object #<Object> has no method 'info'
at /usr/local/lib/node_modules/ftpsync/lib/ftpsync.js:218:16
at /usr/local/lib/node_modules/ftpsync/node_modules/async/lib/async.js:254:17
at /usr/local/lib/node_modules/ftpsync/node_modules/async/lib/async.js:203:33
at /usr/local/lib/node_modules/ftpsync/node_modules/async/lib/async.js:251:21
at Array.1 (/usr/local/lib/node_modules/ftpsync/lib/ftpsync.js:437:7)
at Ftp.parse (/usr/local/lib/node_modules/ftpsync/node_modules/jsftp/lib/jsftp.js:241:13)
at Ftp.parseResponse (/usr/local/lib/node_modules/ftpsync/node_modules/jsftp/lib/jsftp.js:158:8)
at Stream.<anonymous> (/usr/local/lib/node_modules/ftpsync/node_modules/jsftp/lib/jsftp.js:129:24)
at Stream.EventEmitter.emit (events.js:95:17)
at ResponseParser.reemit (/usr/local/lib/node_modules/ftpsync/node_modules/jsftp/node_modules/event-stream/node_modules/duplexer/index.js:70:25)
Am I doing something wrong?
I got this error, the ftp server maybe windows ,I guess.
Collection complete.
Consolidating
-------------------------------------------------------------
Mkdir:
[ '/2015',
'/2015/try-hexo',
'/2015/update-openssh-6',
'/archives/2015',
'/archives/2015/11' ]
Rmdir:
[ '/tasks2', '/archives/5', '/5' ]
Add:
[ '/2015/try-hexo/index.html',
'/archives/2015/11/index.html',
'/archives/2015/index.html' ]
Updates:
[]
Remove:
[ '/hjtkdz2.apk' ]
Consolidation complete.
Committing
-------------------------------------------------------------
MKDIR failed.
MKDIRs failed.
Commit failed.
Commit complete.
MKDIRs complete.
- ./wwwroot/2015 created successfuly
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: 550 ./wwwroot/2015: Cannot create a file when that file already exists.
at Ftp.parse (/Users/keel/dev/hexo/node_modules/jsftp/lib/jsftp.js:257:11)
at Ftp.parseResponse (/Users/keel/dev/hexo/node_modules/jsftp/lib/jsftp.js:174:8)
at Stream.<anonymous> (/Users/keel/dev/hexo/node_modules/jsftp/lib/jsftp.js:146:24)
at emitOne (events.js:77:13)
at Stream.emit (events.js:169:7)
at ResponseParser.reemit (/Users/keel/dev/hexo/node_modules/duplexer/index.js:70:25)
at emitOne (events.js:77:13)
at ResponseParser.emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:146:16)
at ResponseParser.Readable.push (_stream_readable.js:110:10)
at ResponseParser.Transform.push (_stream_transform.js:128:32)
at ResponseParser.<anonymous> (/Users/keel/dev/hexo/node_modules/ftp-response-parser/index.js:65:12)
at Array.forEach (native)
at ResponseParser._transform (/Users/keel/dev/hexo/node_modules/ftp-response-parser/index.js:48:9)
at ResponseParser.Transform._read (_stream_transform.js:167:10)
at ResponseParser.Transform._write (_stream_transform.js:155:12)
at doWrite (_stream_writable.js:292:12)
at writeOrBuffer (_stream_writable.js:278:5)
at ResponseParser.Writable.write (_stream_writable.js:207:11)
at Socket.ondata (_stream_readable.js:528:20)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
I saw this in the readme:
The core functionality to push files to a remote server is now fully implemented. Until the timestamp comparison logic is worked out, updates (ie overwriting files) are determined solely by comparing file sizes
And was wondering if this feature is still under active development, or if there have been any problems you've encountered. I'm asking because the package works very well, except for the updating of files with different, but similarly sized content. Which is very laborious to check for manually.
@evanplaice This ftpsync is too long with no update , and I forked your project , Start my own branch , If you don't want me to do so , Let me know !
Hi there,
I'm getting a 503 bad sequence of commands error. I'm sending up quite a lot of files.
I think the issue is with the callbacks. I'm not sure if the issue lies here or in jsftp. This happens when ftp.put is called.
The only thing I noticed is that the sequence of response code changes when it gives the error.
Another words, it is doing the following sequence:
227
150
226
227
150
226
This is all fine but then it does the following.
227
150
227
226
503.
Would you have any ideas?
I am getting the "Error 550 Can't create directory: No such file or directory" error upon committing. The log says that MKDIR failed creating a directory. I have checked the permissions on ftp and as I have made one initial commit to ftp and everything worked I don't think it has anything to do with ftp permissions.
Didn't check with accents on directories but discovered errors on removing files with accent (like é) during sync operation on ftp. Copying without any troubles but removing files with accent on ftp gives : 550 File not found error.
See extract of ftpsync + ftp server logs below for more details :
''
'Consolidating'
'-------------------------------------------------------------'
'Mkdir:'
[]
''
'Rmdir:'
[]
''
'Add:'
[ '/HOME-abonnés.jpg' ]
''
'Updates:'
[]
''
'Remove:'
[ '/HOME-abonnés.jpg' ]
''
Consolidation complete.
''
'Committing'
'-------------------------------------------------------------'
'-'
Additions complete.
Remove failed.
Removals failed.
Commit failed.
Commit complete.
Removals complete
'-'
Warning: 550 File not found Use --force to continue.
Aborted due to warnings.
Ftp shows :
230 Logged on
type I
200 Type set to I
pasv
227 Entering Passive Mode (...)
stor /HOME-abonnés.jpg
150 Opening data channel for file upload to server of "/HOME-abonnés.jpg"
226 Successfully transferred "/HOME-abonnés.jpg"
dele /HOME-abonnés.jpg
550 File not found
disconnected.
Thanks in advance
Getting error wen running ftpsync.
Setup
Setup complete.
Collecting
C:\Users\Me\AppData\Roaming\nvm\v5.8.0\node_modules\ftpsync\node_modules\jsftp\lib\jsftp.js:374
socket.on("data", function(data) {
^
TypeError: Cannot read property 'on' of undefined
at C:\Users\Me\AppData\Roaming\nvm\v5.8.0\node_modules\ftpsync\node_modules\jsftp\lib\jsftp.js:374:13
at C:\Users\Me\AppData\Roaming\nvm\v5.8.0\node_modules\ftpsync\node_modules\jsftp\lib\jsftp.js:54:24
at Array.<anonymous> (C:\Users\Me\AppData\Roaming\nvm\v5.8.0\node_modules\ftpsync\node_modules\jsftp\lib\jsftp.js:556:14)
at Ftp.parse (C:\Users\Me\AppData\Roaming\nvm\v5.8.0\node_modules\ftpsync\node_modules\jsftp\lib\jsftp.js:237:13)
at Ftp.parseResponse (C:\Users\Me\AppData\Roaming\nvm\v5.8.0\node_modules\ftpsync\node_modules\jsftp\lib\jsftp.js:148:8)
at Stream.<anonymous> (C:\Users\Me\AppData\Roaming\nvm\v5.8.0\node_modules\ftpsync\node_modules\jsftp\lib\jsftp.js:119:24)
at emitOne (events.js:90:13)
at Stream.emit (events.js:182:7)
at Stream.reemit (C:\Users\Me\AppData\Roaming\nvm\v5.8.0\node_modules\ftpsync\node_modules\duplexer\index.js:70:25)
at emitOne (events.js:90:13)
Windows 10
Node 5.8 (Also tried with 4.x versions and got same error)
Hi,
Thank for your awesome ftp nodejs.
This nodejs module cannot download all files of a folder which contains more than 1000 files.
It can only download 300-700 files at one times
Hi,
I really enjoy the deploy function but I was wondering if it's possible to exclude a remote folder during the sync process. I have a folder on my server that is independant from my project and I don't want him to be remove during the process.
I know there is an ignore setting for FTPSync but I don't understand how to ignore a folder.
Is it possible ?
Thanks
ftp.raw.mkd(dir, function(err, data) {
^
TypeError: ftp.raw.mkd is not a function
Great work on the module. Really dig its simplicity. Small improvement request: being able to pass the filename of the config.json file. I have so many other stuff in the root of my project, and it would be great if we could change it. Other than that, love it!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.