Download all source code files through SFTP - sftp

I need to back up all the code from a server onto a local machine. By code I mean any text-based file (.php, .js, .html, etc). The server contains over 300GB of various media (.ogg, .mov, .mp4, .pdf, etc) which I do not want to download.
I am trying to use WinSCP to download only the desired files, but its not working. I set an "Input Mask", but all files are being downloaded anyway.
I would really appreciate some suggestions..

You need to add the directory in. In this case since it seems you want them from every directory, you would change your mask to */*.*html; */*.htm, etc.

Related

Atom Remote Sync - Upload compiled CSS file when saving Less file?

I'm a new user of GitHub's Atom and I installed the less-autocompile package to automatically compile my Less files to CSS. I'm wondering if there's a way I can upload my compiled CSS file to my remote server when saving my Less file.
Right now I'm using Atom's Remote Sync package to upload my files through FTP on save.
When I save changes to my Less file, the actual Less file gets uploaded to my server but what I would like to achieve is that when saving my Less file, the compiled CSS file gets uploaded to my remote server as well.
Right now I have to save the CSS file manually so it gets uploaded, this is breaking my workflow.
Does anyone know how to achieve this?
Thank you!

Checking Wordpress core files

Is there a script or something that can check if all core files are installed properly. I am installing a Wordpress site on clients hosting, and for some reason around 100 files were not transferred due to the connection time out. Now I am moving them one by one, but still I would like to check somehow, once I am done, that all files transferred are there and their size is more than 0b.
Thanks.
Since you are using Filezilla, drag and drop all files again into the folder.
Then when the file exists message shows up, pick Overwrite if different size and check apply to current queue only. Then only the ones with different sizes (or the ones that weren't transferred) will be overwritten/updated.
There's an easier way:
If you have access to some kind of control panel like cPanel, you can make a .zip file and upload it only via Filezilla.
Then on cPanel, go to File Explorer and unzip from there. Will be faster and you just have to upload one file (rather than opening tons of connections and giving you timeout).
Or if you have shell access, you can login with your key using Terminal(mac) or Putty(win), browse the folder and run the unzip command.

On the fly zip or tar creation?

I may NOT bother with this but if its very simple i may consider it. The site i am working on by design is to hold hundreds of thousands of files. I dont know if we'll have only one download or multiple. Right now the choices are A) Just the file B) An archive that has the file + license and conditions.
I am trying to figure out it can be efficient to offer both and use something like file.open/read prefixing an archive header before it and after it which contains the license and other zip contents. My biggest worries are doing file open/read will not be as efficient as letting the server transmit the file and if its hard to generate and change the contents of the zip dynamically (if a user wishes to change the license or if we want to add other data such as author description, author URL and a permalink on the site)
Is it efficient and how would i create the file dynamically only the original file and data pulled from the database?
PS: I am using debian/apache/asp.net using xsp.net and mono.
SharpZipLib is a very nice stream based library that you can use to create archive files.
You can use zip libraries (System.IO.Packaging.ZipPackage, dotnetzip, SharpZipLib) or event command line programs (say 7zip) for compressing the file
. The library should offer better performance.
However, important thing will be to add an caching layer i.e. zip files should be cached in file system so that they can be served directly if request comes for the same.

how can we prevent .exe type file upload in a website?

Suppose we have a example.exe file.
we first put that file in a new folder
and then zip that folder with any zipping software,
Can we prevent that zipped folder upload in a website?
how can we do that?
You cannot prevent it, because you can't tell what the browser is going to submit before it submits it. All you can do is when the file arrives on the server, check the file extension - if it's an exe (or a .zip and you open it up and find an .exe) then reject it.
You can use something like SWFupload to get a handle on the file before it's uploaded, but the best that'll do is tell you the name of the file.
Besides, they could just take "example.exe" change the name to "example.txt" and still upload it...
You check on the server. Checking with javascript in form.onsubmit is dumb because its quite simple to post a form with a file to the same URL and skip your super secure javascript powered page.

Why is FileInfo showing an extra file extension?

I have been having problems with creating a download list of files for a downloader and was getting unexplained "File Does Not Exist" returns. My .avi files were returning found but but .exe and .txt files were getting the not exists.
I have now found by pulling in the whole directory and examining the file contents that my .exe files are showing ".exe.exe". My .txt files are showing ".txt.rtf". Wow, browsing the file directory in Server 2008 only shows a single extension. I don't see an option to display the extension as a column, just the "type". My directory looks like this:
Name Type
File1.exe Application
File2.txt Rich Text Document
File3.avi AVI File
I had renamed some of these files, maybe I just cannot rename files. I will try using originals ans see if I am ok. Maybe I need to rename the offending files without the displayed extensions. Is this just something weird with the server browser?
Thanks,
James
Have you checked that "Tools > Folder Options > View > Hide extensions for known file types" is unchecked?
The option should be in (more or less) the same place on Windows Server 2008, I'm answering from home so I only have XP Pro to go on ;)
Obvious I know, but it sometimes is the obvious answer that we overlook.
Just to add - there's no option to show the extension in a separate column.
Windows has a "feature" that hides file extensions for known file types. Always turn that off or you'll find yourself creating problems like this.

Resources