files back-ups
You know how Linux makes a back-up file every time a file is edited, is there a way to have that file saved to a specified folder instead of it always being saved in the original file's directory?
I'm using KDE if that matters... |
It doesn't so much matter that you are using kde, as it does matter which program you are using. If you are using kwrite, then no, I don't think so. On the bright side, if you are just trying to avoid the clutter, there is something you can do with kwrite: Settings-> configure editor-> Open/Save-> Prefix = .
If the Prefix setting is comprised of a single period, then every temporary save file will have a period added to the front of it. In unix (and linux) this will make it a hidden file. The file will still be there, but you wont normally be able to see it. |
Why would you want to that? I would think that right there near the original is where it would be most useful. -- It's not that it's some kind of versioning control. One problem w/ putting them all in the same dir. is name space collision.
|
Ok thanks, I was using Kedit to edit html files, and I didn't want a ton of back-ups floating around with the originals.
|
Were you getting more than 1 backup per edited file?
|
Nope, just 1 back up per original
|
So the annoying "ton of back-ups" was large only because of the number of files edited.
If it's that important you could (& we could help you) write a script to delete the back-ups, it could even be set to leave newer ones. You could also put it in as a cron job. Instead of deleting, you could just move them to a back-ups sub-dir. |
Quote:
|
Do you need help writing the script?
|
I've never tried writing a script before.
|
Would you like to try?
It's little more than putting the necessary commands in a file. |
sure always up for learning something new in Linux
|
Planning 1st.
Where will the script live? Will it operate only in its own dir., or will it be put someplace like /usr/local/bin? Will it have to check for &/or make the necessary sub-dir, or can it count on that being provided? Will it move all back up files, of only older ones? How will it recognize back up files? Just Start Writing Almost self-explanatory -- what commands wold you issue on the CLI to accomplish your goal? I suggest you try writing & posting (here, of course) the code, keeping in mind my planning Q's as well as any ideas I have overlooked. Please use LQ "Code:" blocks. BTW, this is one of my ideas of fun. :) |
Have you lost interest?
|
Quote:
Is a script file just a txt file with commands in it? And what makes it executable? I'm assuming it's not as simple as Code:
cd /home/replica/webpages |
All times are GMT -5. The time now is 11:33 AM. |