Page 3 of 4

cleanup script copy update

Posted: 06 Nov 2017, 16:42
by abelM
Thank you brokenman!

Could we download just the initrd.xz instead of the whole ISO file? Anyway I don't know if someone makes Porteus load the ISO at boot time

Best regards,

cleanup script copy update

Posted: 06 Nov 2017, 16:55
by Ed_P
Hi
abelM wrote:
06 Nov 2017, 16:42
I don't know if someone makes Porteus load the ISO at boot time
Hi abelM my name is Ed_P and I boot ISOs, especially Porteus ISOs. :)

cleanup script copy update

Posted: 06 Nov 2017, 20:58
by abelM
Hi Ed, I suposed so :roll: Now I hope brokenman will upload both files -- ISO and initrd.xz -- so we can test them ;)

cleanup script copy update

Posted: 07 Nov 2017, 16:43
by M. Eerie
Hi abelM , your initrd.xz is located inside your /boot/syslinux folder in your Porteus media. You can uncompress and compress yourself from the terminal like @brokenman explains here -->

viewtopic.php?p=53718#p53718

Also, you can have a look at this article --> http://www.porteus.org/component/conten ... ernel.html

Once uncompressed, you can replace all ocurrences of cp -af to cp -afu in the tree like this -->

Code: Select all

find . -type f -print0 | xargs -0 sed -i 's/cp -af/cp -afu/g'
Then pack it again and give it a try :)

BTW: I found the article in this very forum on how to unpack/repack the initrd.xz by googleing

cleanup script copy update

Posted: 07 Nov 2017, 19:18
by abelM
Thanks M. Eerie!

Interesting tip indeed. However the new initrd.xz includes a version of busybox which does support cp -u. The cleanup script should also be modified I think. That's why I've asked brokenman for the initrd.xz -- and Ed for the iso file. Editing cleanup and repacking the present initrd.xz won't be effective and worse: cp will copy nothing and exit with an error message. Just to see please try

Code: Select all

/mnt/live/bin/cp -afu SOURCE DEST
Regards

cleanup script copy update

Posted: 12 Nov 2017, 19:26
by brokenman
I'll do my best to upload a new version tonight.

cleanup script copy update

Posted: 23 Nov 2017, 19:00
by abelM
Hi brokenman,

I'd like to know if there's an updated initrd.gz for downloading

Thank you!

cleanup script copy update

Posted: 23 Nov 2017, 20:23
by brokenman
The latest was uploaded on 20/11/2017.
It does not contain your patches.
http://brokenman.porteus.org/current/x86_64/dev/

Sorry. Forgot to add. In porteus you can mount an ISO file over the internet and just extract the initrd.xz file. Read about httpfs2.

cleanup script copy update

Posted: 23 Nov 2017, 21:36
by abelM
Nice tip. Thank you very much!

cleanup script copy update

Posted: 26 Nov 2017, 12:16
by abelM
Hi all,

Until we get a patched cleanup script I'm running a modified dump-session at shutdown -- bypassing cleanup. You'll find the code at direct update at dump session (Post by abelM #60431)

Code: Select all

#!/bin/sh
# rc.local_shutdown
dump-session && rm -f /mnt/live/tmp/changes-exit
/mnt/live/tmp/changes-exit is removed so cleanup won't find it and will not activate its own save changes code.

Regards,

cleanup script copy update

Posted: 27 Nov 2017, 19:26
by abelM

cleanup script copy update

Posted: 29 Nov 2017, 22:47
by abelM
I've made some small fixes you can see at direct update at dump session (Post by abelM #60653)

Regards,

cleanup script copy update

Posted: 30 Nov 2017, 05:41
by Ed_P
Impressed with your attachment to the changes=EXIT process abelM. :)

A question I have is how come I've had to change my save.dat file size over the years from 256MB to 320 to 512 to 1GB (60+ % used) yet when I save just my changes, using a script I made, it is only 7.3MB?

I identify my changes by doing nothing for a couple of minutes, making my change, then running this script:

Code: Select all

#!/bin/sh
# http://forum.porteus.org/viewtopic.php?f=81&t=3776#p27204
  
X=1
if [ ! "$1" == "" ]; then
   X=$1
fi  

echo " mmin = "$X

if [ `whoami` != "root" ]; then
    echo -e "Enter root's password"
    su -c "sh $0 $1"
    exit
fi

find /mnt/live/memory/changes  -iname "*" -mmin -$X
read
exit

cleanup script copy update

Posted: 30 Nov 2017, 14:10
by abelM
Hi Ed,

The same has been for me! I've inspected some places to find out:
  • Contents of my save.dat file as you can see in /mnt/live/memory/images/changes.
  • Files under /mnt/live/memory/changes
  • Folders included and excluded in /etc/changes-exit.conf
In my personal system I've realized downloaded files, saved documents, and web cached pages, grew until save.dat had no room left. My decision was to do this:
  • Save files by using magic folders or symlinks pointing to folders -or filesystem images eventually- out of save.dat
  • Exclude unneeded folders -web browser cache and some other- in changes-exit.conf
My 256M save.dat keeps mostly configuration files now and it has plenty of room left! Besides if something goes very bad -my fault as a rule- I can always build a new save.dat without any important loss :oops:

BTW I've tried something like you to see recent changes -- using a different approach

Code: Select all

IFS="
"
find /mnt/live/memory/changes -newer /mnt/live/memory/changes/etc/fstab
unset IFS
This way I can see files created or modified just at the present session. I've chosen to compare with fstab for it's recreated at every boot. Resetting IFS is useful to handle files with spaces in their names.

You can also see the number of files and total size of recent changes

Code: Select all

find /mnt/live/memory/changes -newer /mnt/live/memory/changes/etc/fstab | wc -l 
du -sh `find /mnt/live/memory/changes -newer /mnt/live/memory/changes/etc/fstab` 
Regards!

cleanup script copy update

Posted: 30 Nov 2017, 14:32
by apollo
Hi abelM,

thanks for sharing your thoughts. :good:
Exclued unneeded folders from changes is a thing i´ve been looking for...didn´t come across the solution you mentioned. Will give it a try later.

cheers