Page 1 of 4

cleanup script copy update

Posted: 22 Oct 2017, 13:00
by abelM
Hi guys!

I'm using Porteus 3.2.2 on a laptop with sdcard storage and I've added `changes=EXIT:porteussave.dat' to the command line in order to decrease writes as possible. I see `cleanup' script copies the whole content from folders in the live directory to persistent media applying a `cp -af --parents' statement. I wonder if `cp -afu --parents' could be a better choice. The cp command with the `-u' option just updates files so writes would be less yet. What do you think?

Greetings,

cleanup script copy update

Posted: 22 Oct 2017, 20:36
by brokenman
Thanks abelM. I've updated the cleanup script with your suggestion.

cleanup script copy update

Posted: 22 Oct 2017, 21:22
by Ed_P
:thumbsup:

cleanup script copy update

Posted: 22 Oct 2017, 23:04
by Ed_P
BTW Where is this script located guys? I'd like to make the change in my 3.2.2 system.

cleanup script copy update

Posted: 23 Oct 2017, 21:16
by abelM
Hello brokenman. Thank you for your quick answer!
Regards,

cleanup script copy update

Posted: 23 Oct 2017, 23:47
by brokenman
The script is located inside initrd.xz. It's called cleanup.

cleanup script copy update

Posted: 24 Oct 2017, 00:36
by Ed_P
Thank you brokenman. :beer: I think I will wait for the fix in the next release. :happy62:

But I may look into this initrd.xz file now though. :) Never done that before.

cleanup script copy update

Posted: 24 Oct 2017, 03:50
by Ed_P
Interesting. :o Cleanup is in my /mnt/live folder!! So I can update it without rebuilding the ISO. :Yahoo!:

cleanup script copy update

Posted: 24 Oct 2017, 05:43
by Ed_P
Thanks brokenman. :happy62: changes=EXIT shutdowns are considerably faster now. :thumbsup:

cleanup script copy update

Posted: 24 Oct 2017, 22:48
by abelM
Hello brokenman,

Something's going wrong with the new cleanup script for I can't save changes now. I'm sorry I don't understand which is the problem but it was working before. Maybe something with the aufs but I'm not sure. I've moved back to the original script for now. I suggest you to keep the original version in you tree too.

Regards,

cleanup script copy update

Posted: 25 Oct 2017, 13:27
by abelM
Hi guys,

I see the EXIT code is working for you with the new cleanup script. Are your files being really saved between sessions? If so the good news is you make much less writes to flash drives and you logout really faster. :D The bad news is I've messed up myself playing around with different persistent devices. :mega_shok: Please tell me!!!

cleanup script copy update

Posted: 25 Oct 2017, 13:30
by abelM
Hi brokenman,
I'd like to know what you think about this stuff. Regards

cleanup script copy update

Posted: 25 Oct 2017, 20:45
by Ed_P
:shock: Wow!! I'm glad one of us checked that aspect of the change. :oops:

You are correct abelM. :happy62:

Because I ISO boot Porteus the cleanup script in my /mnt/live/ folder is fresh with each boot so I made a script to edit it like you directed that I run before shutting down.

cleanup.sh

Code: Select all

#!/bin/sh
echo guest | sudo -S sed -i 's/cp -af /cp -afu /' /mnt/live/cleanup
echo
It works and the access rights of the cleanup file do not change.

Code: Select all

guest@porteus:~$ ls -l /mnt/live/cleanup
-rwxr-xr-x 1 root root 4048 Apr 15  2016 /mnt/live/cleanup*
guest@porteus:~$ ./cleanup.sh
Password: 
guest@porteus:~$ ls -l /mnt/live/cleanup
-rwxr-xr-x 1 root root 4049 Oct 25 16:17 /mnt/live/cleanup*
guest@porteus:~$
Very strange that your cleanup change results in changes not being saved. And no error msg to indicate that or why. :%)

cleanup script copy update

Posted: 25 Oct 2017, 22:09
by abelM
Thank you Ed! If I'm right cleanup uses cp from /mnt/live/bin/cp --really busybox v1.21.1-- and it seems the -u flag doesn't work. But I must investigate a bit more. I'll also try your way to see what goes on here. :teehee:

cleanup script copy update

Posted: 25 Oct 2017, 23:49
by Ed_P
Well, no error msg when using the u.

Code: Select all

guest@porteus:~$ mkdir /tmp/test ; cp -afu Savedat /tmp/test 
guest@porteus:~$ ls /tmp/test/
Savedat/
guest@porteus:~$ 
guest@porteus:~$ ls /tmp/test/Savedat/
Rebuild.sh*   colors.rc     recover.sh         savedat.sh*      spaceused.sh*
bluebkgrd.rc  greentxt.rc*  redtxt.rc          savedat2xzm.sh*
bluetxt.rc    msgbox.sh*    removewhfiles.sh*  spaceck.sh*
guest@porteus:~$ cp -afu Savedat /tmp/test 
guest@porteus:~$ ls /tmp/test/Savedat/
Rebuild.sh*   colors.rc     recover.sh         savedat.sh*      spaceused.sh*
bluebkgrd.rc  greentxt.rc*  redtxt.rc          savedat2xzm.sh*
bluetxt.rc    msgbox.sh*    removewhfiles.sh*  spaceck.sh*
guest@porteus:~$ 
:unknown: