HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=16)
-   -   No .htaccess in automatic backup? (http://www.howtoforge.com/forums/showthread.php?t=3280)

tron 22nd March 2006 15:58

No .htaccess in automatic backup?
 
I've noticed that the automatic backup functionality doesn't backup .htaccess files. The man page of zip explains that I need to add ".* *" instead of just "*" as a parameter to include them. EDIT: them = files starting with a dot

Looking at /root/ispconfig/scripts/shell/backup.php tells me that you are using just the "*" so I thought that changing it to the above would be the way to go. But then I looked at the webN_user.zip and saw files starting with a dot in that zip such as .antivirus.rc. On the other hand the file .no_delete is not included. Now I am confused.

Why is .antivirus.rc included but .htaccess isn't?

I assume you either forgot about .htaccess or there is a good reason to not include .htaccess in the backup. What reason would that be?

If I want to include .htaccess in the backup, changing
Quote:

exec("cd $web_pfad; $zip -r $tmp_dir/web".$web_id."_web.zip *");
to
Quote:

exec("cd $web_pfad; $zip -r $tmp_dir/web".$web_id."_web.zip .* *");
would do the trick, wouldn't it? Running "zip test.zip .* *" works for me.

Thank you very much.

falko 22nd March 2006 16:39

Quote:

Originally Posted by tron
But then I looked at the webN_user.zip and saw files starting with a dot in that zip such as .antivirus.rc. On the other hand the file .no_delete is not included. Now I am confused.

I guess this has something to do with permissions: .no_delete is owned by root and has 400 permissions. It must be similar with the other files that are not included in the zip file.

tron 22nd March 2006 17:46

First of all, I need to revise my statement from above. .htaccess files are included in the backup except /var/www/webN/web/.htaccess. Sorry for that.

I just verifed your point with my setup:

All .no_delete files are owned by root and have 400 permissions
All .antivirus.rc files etc. except .vacation.cache are owned by root and have 644 permissions
All /var/www/webN/web/.htaccess files are owned by root and have 644 permissions

I've got one .htaccess two directory levels further down with the same permissions and this one is included in the backup as well. The one from /var/www/webN/web/stats/ is owned by the respective user and has 664 permissions. They are also included in the backup.

So, permissions shouldn't be the problem, should they?

Anyway, I have now changed the appropriate line in the backup script to
Quote:

exec("cd $web_pfad; $zip -r $tmp_dir/web".$web_id."_web.zip .htaccess *");
This seems to work whereas
Quote:

exec("cd $web_pfad; $zip -r $tmp_dir/web".$web_id."_web.zip .* *");
gave me all sorts of errors when unzipping the zip file.

falko 22nd March 2006 18:03

Quote:

Originally Posted by tron
All .no_delete files are owned by root and have 400 permissions
All .antivirus.rc files etc. except .vacation.cache are owned by root and have 644 permissions
All /var/www/webN/web/.htaccess files are owned by root and have 644 permissions

Files with 644 permissions should always be included, as everybody has read permissions. Files with 400 are only included if the backup is run as the file owner.


All times are GMT +2. The time now is 00:36.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.