[opensuse] is it generally recommended to write software that NOT store temporary files in home directory?
Dear all I was wondering is there a best practice or conventional suggestion that software should not write temporary files in user's home directory, but do it on /tmp/ or /var/tmp? I ask this because when I want to backup a live user profile usually it fails thanks to file size change during backup. Most of them are temporary files. In my case it is a bit difficult to back it up by asking the user to log out, because I can only access their computers in working hour, and they are working in working our, especially backup takes perhaps 1 hour, and I don't want to interrupt them by 1 hour. After working hour they took back their notebooks. I start to think, that is it by design backup should be when user not logged in, or is there exist a convention of not using ~/.app as temp but software designers tends to ignore that? Thanks. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Zhang Weiwu wrote:
Dear all
I was wondering is there a best practice or conventional suggestion that software should not write temporary files in user's home directory, but do it on /tmp/ or /var/tmp?
I ask this because when I want to backup a live user profile usually it fails thanks to file size change during backup. Most of them are temporary files. In my case it is a bit difficult to back it up by asking the user to log out, because I can only access their computers in working hour, and they are working in working our, especially backup takes perhaps 1 hour, and I don't want to interrupt them by 1 hour. After working hour they took back their notebooks. I start to think, that is it by design backup should be when user not logged in, or is there exist a convention of not using ~/.app as temp but software designers tends to ignore that?
Thanks.
Great question. But define fails? Does the backups software not offer the option to use advisory locks, ro simply ignore locks? Or are you saying that the backup reads everything fine, but it's never possible to get a clean verify since always some files have changed by the time the subsequent verify happens? I would say in this case that, under the conditions you are forced to work within, and if you can not change these conditions (arrange for dedicated backup time or change the software being used by the users), that you simply have to give up on being able to verify /home. I don't know of any especially official standard or practice that says a user mode app shall avoid using anything but one of the central */tmp directories for work files. There may be but I'm simply not addressing that part of the question since I have only my own opinion, not a definitive answer for it. -- bkw -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Brian K. White said the following on 12/28/2009 01:44 AM:
I don't know of any especially official standard or practice that says a user mode app shall avoid using anything but one of the central */tmp directories for work files. There may be but I'm simply not addressing that part of the question since I have only my own opinion, not a definitive answer for it.
There are good reasons - apart from tradition - for using /tmp for temporary files instead of /home/<user>/tmp. Lets start with the fact that not all programs and scripts clean up after themselves so lets put them where a reaper program can clean them up periodically. Yes, in an idea world a program would open the temp file then unlink it so that it would be automagically cleared when the program exits or aborts, but not all programmers are that smart or that careful There are also some vulnerabilities that are exploited when the temporary files are on the same file system as an executable or library. (q.v.) Having /tmp as a separate file system that can be mounted 'noexec' and 'nosetuid' is a good idea. SymLinking each user's ~/tmp to /tmp or /tmp/<user> is one way to deal with some classes of 'broken' programs. If your problem is really to do with backing up open and size-changing files, then that is another matter. It seems pretty pointless to me since the relevance of the working file will depend on the state of the program executing that is using it, and that program's state - core image - is not being preserved synchronously with the working file, and hence the working file need not be part of the backup set. Either exclude /home/*/tmp or use the Symlink and don't follow it when backing up. -- "Ahhh. A man with a sharp wit. Someone ought to take it away from him before he cuts himself." - Peter da Silva -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Monday 28 December 2009 13:58:28 Zhang Weiwu wrote:
Dear all
I was wondering is there a best practice or conventional suggestion that software should not write temporary files in user's home directory, but do it on /tmp/ or /var/tmp?
I ask this because when I want to backup a live user profile usually it fails thanks to file size change during backup. Most of them are temporary files. In my case it is a bit difficult to back it up by asking the user to log out, because I can only access their computers in working hour, and they are working in working our, especially backup takes perhaps 1 hour, and I don't want to interrupt them by 1 hour. After working hour they took back their notebooks. I start to think, that is it by design backup should be when user not logged in, or is there exist a convention of not using ~/.app as temp but software designers tends to ignore that?
Thanks.
Do you need to backup those temporary files. I think you can use a filter or something like this. Just backup the files you needed. In my opinion, any temporary file is not necessary and should not be backed up. This would save some space and backup time too. Perhaps this is not related to your problem, just some personal opinions. -- Yang Bo -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (4)
-
Anton Aylward
-
Brian K. White
-
Yang Bo
-
Zhang Weiwu