cleanup script copy update

New features which should be implemented in Porteus; suggestions are welcome. All questions or problems with testing releases (alpha, beta, or rc) should go in their relevant thread here, rather than the Bug Reports section.
User avatar
abelM
Black ninja
Black ninja
Posts: 50
Joined: 22 Oct 2017, 12:35
Distribution: Porteus v-3.2.2 64 bit
Location: Argentina
Contact:

cleanup script copy update

Post#31 by abelM » 06 Nov 2017, 16:42

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,

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

cleanup script copy update

Post#32 by Ed_P » 06 Nov 2017, 16:55

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. :)
Ed

User avatar
abelM
Black ninja
Black ninja
Posts: 50
Joined: 22 Oct 2017, 12:35
Distribution: Porteus v-3.2.2 64 bit
Location: Argentina
Contact:

cleanup script copy update

Post#33 by abelM » 06 Nov 2017, 20:58

Hi Ed, I suposed so :roll: Now I hope brokenman will upload both files -- ISO and initrd.xz -- so we can test them ;)

User avatar
M. Eerie
Moderator
Moderator
Posts: 619
Joined: 31 Aug 2017, 21:18
Distribution: Nemesis Xfce/MATE x64

cleanup script copy update

Post#34 by M. Eerie » 07 Nov 2017, 16:43

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
> Does not compute_ 🖖

https://forum.porteus.org/viewtopic.php?p=94310#p94310
https://forum.porteus.org/viewtopic.php?p=84002#p84002
https://forum.porteus.org/viewtopic.php?p=77174#p77174
https://forum.porteus.org/viewtopic.php?f=39&t=8584

User avatar
abelM
Black ninja
Black ninja
Posts: 50
Joined: 22 Oct 2017, 12:35
Distribution: Porteus v-3.2.2 64 bit
Location: Argentina
Contact:

cleanup script copy update

Post#35 by abelM » 07 Nov 2017, 19:18

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
Last edited by abelM on 23 Nov 2017, 18:58, edited 1 time in total.

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

cleanup script copy update

Post#36 by brokenman » 12 Nov 2017, 19:26

I'll do my best to upload a new version tonight.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
abelM
Black ninja
Black ninja
Posts: 50
Joined: 22 Oct 2017, 12:35
Distribution: Porteus v-3.2.2 64 bit
Location: Argentina
Contact:

cleanup script copy update

Post#37 by abelM » 23 Nov 2017, 19:00

Hi brokenman,

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

Thank you!

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

cleanup script copy update

Post#38 by brokenman » 23 Nov 2017, 20:23

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.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
abelM
Black ninja
Black ninja
Posts: 50
Joined: 22 Oct 2017, 12:35
Distribution: Porteus v-3.2.2 64 bit
Location: Argentina
Contact:

cleanup script copy update

Post#39 by abelM » 23 Nov 2017, 21:36

Nice tip. Thank you very much!

User avatar
abelM
Black ninja
Black ninja
Posts: 50
Joined: 22 Oct 2017, 12:35
Distribution: Porteus v-3.2.2 64 bit
Location: Argentina
Contact:

cleanup script copy update

Post#40 by abelM » 26 Nov 2017, 12:16

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,

User avatar
abelM
Black ninja
Black ninja
Posts: 50
Joined: 22 Oct 2017, 12:35
Distribution: Porteus v-3.2.2 64 bit
Location: Argentina
Contact:

cleanup script copy update

Post#41 by abelM » 27 Nov 2017, 19:26

Last edited by abelM on 29 Nov 2017, 22:48, edited 1 time in total.

User avatar
abelM
Black ninja
Black ninja
Posts: 50
Joined: 22 Oct 2017, 12:35
Distribution: Porteus v-3.2.2 64 bit
Location: Argentina
Contact:

cleanup script copy update

Post#42 by abelM » 29 Nov 2017, 22:47

I've made some small fixes you can see at direct update at dump session (Post by abelM #60653)

Regards,

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

cleanup script copy update

Post#43 by Ed_P » 30 Nov 2017, 05:41

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
Ed

User avatar
abelM
Black ninja
Black ninja
Posts: 50
Joined: 22 Oct 2017, 12:35
Distribution: Porteus v-3.2.2 64 bit
Location: Argentina
Contact:

cleanup script copy update

Post#44 by abelM » 30 Nov 2017, 14:10

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!

apollo
Black ninja
Black ninja
Posts: 75
Joined: 28 Oct 2017, 13:40
Distribution: 4.0 XFCE, Manjaro
Location: .bay.de

cleanup script copy update

Post#45 by apollo » 30 Nov 2017, 14:32

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

Post Reply