View Single Post
Old 22nd February 2016
e1-531g e1-531g is offline
ISO Quartermaster
 
Join Date: Mar 2014
Posts: 628
Default

I now think that "paranoid user" was not the best phrase.

Anyway inspired by that question and answers:
https://unix.stackexchange.com/quest...-one-partition

I have created a script to update file more safely, than with default filesystem options, but still not sacrifice performance for long period of time.

Code:
/sbin/mount -u -o sync,noatime e2687744d2198a2e.a  / && echo "filesystem in sync" && mount 2>&1 | grep ' / '
#redundancy for updating file, but if you are going to just copy, it is not required
cp /testSync/there_will_be_copied_file1 /testSync/there_will_be_copied_file1.tmp
#copying fresh data, but one should update file insted of copy to it
cp /testSync/file1 /testSync/there_will_be_copied_file1.tmp
mv /testSync/there_will_be_copied_file1 /testSync/there_will_be_copied_file1.old
mv /testSync/there_will_be_copied_file1.tmp /testSync/there_will_be_copied_file1
rm /testSync/there_will_be_copied_file1.old
/sbin/mount -u -o noatime e2687744d2198a2e.a / && echo "filesystem not in sync" && mount 2>&1 | grep ' / '
This gives me output:
Code:
./copy.sh                                                                    
filesystem in sync
/dev/sd1a on / type ffs (local, noatime, synchronous)
filesystem not in sync
/dev/sd1a on / type ffs (local, noatime)
I think that there should also be if statements to check for errors, but it is more like proof of concept.
Of course everybody should do backups, but... maybe this is backup script?

Last edited by e1-531g; 22nd February 2016 at 05:02 PM.
Reply With Quote