Yummy Software
Welcome, Guest. Please login or register.
Did you miss your activation email?
February 26, 2011, 05:17:44 AM
4208 Posts in 850 Topics by 1380 Members
Latest Member: johndur4n
Home Help Search Login Register
Yummy Software  |  Yummy FTP  |  Problems & Bugs  |  How do I zip and unzip files on my server? « previous next »
Pages: [1] Print
Author Topic: How do I zip and unzip files on my server?  (Read 139 times)
deelight
Newbie
*
Posts: 6


How do I zip and unzip files on my server?
« on: February 19, 2011, 04:49:57 PM »

Hello JD and all!

I use YummyFTP with an older version for more than 5 years now and am always happy with the program. Cheesy Now I think about upgrading to 1.8.3 and downloaded the trial version because of itīs ability to create ZIP files on the server.

Now, how do I get ZIPs from my files? I have SoftShell access, use SFTP connection and then in YummyFTP go to the folder of the files I need to zip, activate maybe 10 files, click right, SoftShell-Commands, Create ZIP-Archive. Click.

No ZIP is created, I get the following message for each of the activated files:

.......
bash: line 0: cd: /downloads: No such file or directory
zip error: Nothing to do! (try: zip -rq P_0807_2.jpg.zip . -i P_0807_2.jpg)
.......

What do I have to do? Please notice: I am not a server geek, so please answer in easy words  Thanks!

Best regards, deelight

« Last Edit: February 19, 2011, 04:52:49 PM by deelight » Logged
JD
Administrator
FTP Guru
*****
Posts: 1897


Re: How do I zip and unzip files on my server?
« Reply #1 on: February 19, 2011, 05:57:32 PM »

I think you'll need to contact your server administrator to resolve this issue, but from what I can tell your login home directory in SFTP isn't the same as when you acces the server via shell (SoftShell). It is the latter which Yummy uses to send the zip commands to the server. So, when Yummy tells the server to look at a full path for the file to zip (/downloads in this case) the folder doesn't exist.

If you don't understand, don't worry - I'm sure the server administrator will know what I mean and how to rectify it so this will work.

Note that this is the exception - normally this feature 'just works' because the login home paths are the same.

I'm interested to know which old version of Yummy you were using? The zip feature has been there for the longest time! Smiley
Logged
deelight
Newbie
*
Posts: 6


Re: How do I zip and unzip files on my server?
« Reply #2 on: February 20, 2011, 05:41:12 AM »

Dear JD,

thanks for your reply. Well, I am on 1.1.5 and always have been happy with it, just checked and could not find the SoftShell commands on rightclick. Any other possibility? 

Regarding the problem - it's my server (provider managed) and I am the admin Shocked Sure, I am not a geek, but until now I could resolve all problems and with each new I am always learning...

I contacted the hotline of my server provider, they said I would need to run gzip or something similar and implement it as a file at the home directory of my server. Until now I do not know if this is correct and how to realize. Maybe also I did not understand 100% correct what they meant.

I also learned that server commands can be undertaken by the use of MAC Terminal, but in this particular case trying around without exactly knowing what one is doing might not be the perfect way to learn  Grin

So, if you have an idea what needs to be done to correct the path so that YummyFTP works please let me know.

Thanks & best regards!

deelight
« Last Edit: February 20, 2011, 05:42:58 AM by deelight » Logged
JD
Administrator
FTP Guru
*****
Posts: 1897


Re: How do I zip and unzip files on my server?
« Reply #3 on: February 20, 2011, 06:30:17 AM »

From what your provider is saying it sounds like you would need to install the zip program 'gzip' before you could create and expand zip archives. That normally comes as standard, but your provider should help you do that.

Once that hurdle is out of the way, the issue with zip files directly in Yummy is to do with SSH vs SFTP access to the server.

When Yummy is performing the zip function, it is actually not using SFTP to do this at all - behind the scenes it opens an SSH connection and issues the exact same commands that you would enter if you were using the Mac Terminal app.

And this is where the problem lies:

When connecting via SFTP the connected directory end up as (for example):

/users/yourname/sftp/home/

And when connecting via SSH it might be (again just an example):

/users/yourname/

So you can imagine that if there is a 'downloads' folder inside 'home', when Yummy connects via SSH there is no folder called 'downloads'

Now, if both home folders were the same on both SFTP and SSH then it would work.

Again, I don't know how to set both home folders the same for your server, but I expect your server provider will be able to tell you.
Logged
deelight
Newbie
*
Posts: 6


Re: How do I zip and unzip files on my server?
« Reply #4 on: February 20, 2011, 07:40:48 AM »

Alright, thanks, it seems that my provider is the one to speek to... Hotlines are not really my favourite partners when it comes to solving problems... Wink I will keep you updated what happens.

Thanks & best regards, deelight
Logged
deelight
Newbie
*
Posts: 6


Re: How do I zip and unzip files on my server?
« Reply #5 on: February 22, 2011, 05:18:08 AM »

Dear JD!

Now, after getting help by a very nice IT expert (Thanks, Michael! niewiara-it.de ) I received a bash file with the following content:

---cut---
mycd() { cd /kunden/homepages/322/d514567803/htdocs/$1 ;};
alias cd=mycd
---cut---

The script (.bashrc) aims at filling the uncomplete path with the missing part when it comes to shell acces vs. ftp access point. The script works fine when making a test on the shell, but unfortunately NOT when trying to use the ZIP or TGZ function in YummyFTP. We still get the failure notice that the directory does not exist (see previous post above)

From our point of view we have 2 possibilites now:

1. we find out whats wrong with the path, so we would need to know what exactly is sent by YummyFTP software to the server when the task "create ZIP" is clicked

2. it could be implemented in the software that the user is able to edit or to extend the path sent by YummyFTP

If you have another idea we would be glad to get a hint. Thanks for your help!

Looking forward to your reply 

Best regards,  deelight


« Last Edit: February 22, 2011, 05:41:55 AM by deelight » Logged
JD
Administrator
FTP Guru
*****
Posts: 1897


Re: How do I zip and unzip files on my server?
« Reply #6 on: February 22, 2011, 06:50:19 AM »

An ongoing saga ... Smiley

Well, the problem with the nice script is that Yummy doesn't invoke a bash shell, so the script never gets executed.

Can't your provider set the login directory of your shell access to be the same as the ftp login directory (or vice versa)? This would be the most obvious solution.

When Yummy sends the zip command it is preceded by a cd command. The cd command sets the current directory to the path of the selected file to be zipped according to the FTP server. So, for example:

Your server listing has a file : 'testfile.txt'
Your server's current FTP working directory is : /downloads/files/

Yummy will connect via SSH, send:

cd /downloads/files/

then send:

zip testfile.txt testfile.txt.zip

One option would indeed be to add a new setting to Yummy's Bookmark which specifies the difference between FTP path and SSH path and this is a request that has come up once before for this very same reason. I have it on my To Do list for some time, but I can't say when it might be added.

Logged
deelight
Newbie
*
Posts: 6


Re: How do I zip and unzip files on my server?
« Reply #7 on: February 22, 2011, 04:18:15 PM »

An ongoing saga ... Smiley

Yes... and NO, not anymore  Grin

Michael had a new idea when reading your comment, JD, and - here we go:

......CUT......
mycd() { cd /kunden/homepages/322/d514567803/htdocs/$1 ;};
alias cd=mycd
shopt -s expand_aliases
......CUT......

Now with this .bashrc it works, I can activate a folder in any direction and a ZIP is written into the same direction. Thanks, Michael... also, for giving me the permission to publish the script.

Bye, bye problem - hello YummyFTP 1.8.3 

Best regards, deelight
« Last Edit: February 22, 2011, 05:33:55 PM by deelight » Logged
JD
Administrator
FTP Guru
*****
Posts: 1897


Re: How do I zip and unzip files on my server?
« Reply #8 on: February 22, 2011, 05:23:32 PM »

Wonderful!  Cheesy

Thank you for sharing the solution, and thanks to Michael from me too!
Logged
deelight
Newbie
*
Posts: 6


Re: How do I zip and unzip files on my server?
« Reply #9 on: February 24, 2011, 04:10:40 AM »

One more notice - I received the following hint from another forums member:

According to this person the script may cause problems on a server if you or your users are running other automated server software (e.g. back up software) because it could be misled by the path redirecting.

Not sure if so, on my server there are no scripts & software running except the one above.

However...

Best regards, deelight
Logged
JD
Administrator
FTP Guru
*****
Posts: 1897


Re: How do I zip and unzip files on my server?
« Reply #10 on: February 24, 2011, 05:56:36 AM »

Oh? It's a shame they didn't just post the info to the thread for everyone to see ...

Whoever it was, they have a good point. It probably doesn't affect you, but something to bear in mind for those wishing to implement the script.

I still don't understand why the login directory for your SSH login could not be set the same as your SFTP login by your provider. This appears to be how it is set up for most people, otherwise the zip command in Yummy wouldn't be working for most people - and certainly, it IS working for most people.

In any case, it hilights the need for me to add the SFTP vs SSH login path difference in the Bookmark settings.

Thanks for reporting back! Smiley
Logged
Pages: [1] Print 
« previous next »
Jump to: