Page 1 of 1

[SCRIPT] Save Porteus changes made in definied time period

Posted: 08 Jan 2011, 08:13
by fanthom

Code: Select all



echo "enter time interval or press enter for keeping default value (3 minutes):"
read int
if [ ! $int = "" ]; then

#creating tmp dir
mkdir $tmp

#locating and copying newly created/modified files
file=`find $changes -mmin -$time`

for x in $file; do
cp -P --parents $x $tmp 2> /dev/null

#we dont want to store /root and /tmp folders (you can add or remove paths which will be excluded from saving)
rm -r $tmp/$changes/root /$tmp/$changes/tmp

#moving all stuff to final destination
mv $tmp/$changes $path

echo "all files created/modified in last $time minutes were copied to $path folder"
save it as '/usr/bin/changes-saver' or whatever, and make executable: 'chmod +x /usr/bin/changes-saver'
if you want to remove some dirs other than /root and /tmp - add them to proper place in the script. EXAMPLE:

Code: Select all

rm -r $tmp/$changes/root /$tmp/$changes/tmp /$tmp/$changes/opt
so in next run /opt folder wont be copied to the final destination.


Re: [SCRIPT] Save Porteus changes made in definied time peri

Posted: 08 Jan 2011, 09:09
by brokenman
Be sure to grab this script. It is probably the most useful script i have seen for assemblers/developers !!

As usual ... excellent job fanthom.

Re: [SCRIPT] Save Porteus changes made in definied time peri

Posted: 19 Jan 2011, 13:20
by wread
Fine bussines, fanthom, I was breaking my head trying to find the way to avoid the snow-ball effect that implies creating one module over the others already installed!

Thank you very much!!!