[prev in list] [next in list] [prev in thread] [next in thread]
List: quanta
Subject: Re: [Quanta] backup
From: Andrew Lowe <andrew.lowe () manildra ! com ! au>
Date: 2006-05-03 23:25:10
Message-ID: 200605040925.10685.andrew.lowe () manildra ! com ! au
[Download RAW message or body]
On Wednesday 03 May 2006 17:41, Onno Timmerman wrote:
> Is there a easy way to delete al the backup files when a project is
> finished. Like index.php~
> Because there is always a danger that one of the files gets uploaded,
> that is a security risk!
I personally have changed the backup files to only have a prefix "~BAK~" and
no suffix so that the file index.php would be ~BAK~index.php.
This way it does not matter if a file is uploaded as Apache hands it off to
the PHP engine to handle.
It is still best not to upload a backup file as it may contain errors and
error messages that dump information it should not, however it is less likely
to be found and it is not full code disclosure if you use a prefix rather
then a suffix.
The only down-side is that the files are sorted differently... ie all the
backup files are at the top of the list of files in a directory, rather then
with the original.
To change this setting:
Settings->Configure Editor->Open/Save->Backup on Save: Prefix and Suffix.
To remove all backup files from a directory (and subdirectories) run this bash
script:
for BACKFILE in `find -name ~BAK~*`
do
rm ${BACKFILE}
done
where ~BAK~ is the prefix you use...
The first line does a find all files that start with the prefix and loops
through each one assigning the name of the file to the variable BACKFILE as a
string
each loop we remove the file referred to in the string ${BACKFILE}
BASH scripting is fun in that you assign a variable without a $ but to use one
you must put the $. The braces {} can help with some problems (strings with
spaces? but I cannot remember) so I always use them.
The best place to look for BASH scripting help is the Advanced Bash-Scripting
Guide at:
http://www.tldp.org/LDP/abs/html/
I hope I have been clear if not ask me for more info. (And I hope I am not too
off topic
--
Andrew Lowe
System Administrator & Programmer
Information Technology
Manildra Group
Email: andrew.lowe@manildra.com.au
Phone: 02 4423 8270
Mobile: 04 1323 8270
Fax: 02 4421 7760
_______________________________________________
Quanta mailing list
Quanta@mail.kde.org
https://mail.kde.org/mailman/listinfo/quanta
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic