I run this on my CentOs box:
zip -r backup.zip /home/user/domains/example.com/public_html/
The command works ok as it should, but I have an annoying problem.
What I expect is when I open the zip to have one folder in it:
Instead i have
/home/user/domains/example.com/public_html/. Does anyone know how to prevent this?
That looks like expected behavior, not strange behavior.
To get what you want, try this:
cd /home/user/domains/example.com zip -r /srv/backups/example.com/backup.zip public_html
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.