cleanup script copy update
- abelM
- 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
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,
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,
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
cleanup script copy update
Thanks abelM. I've updated the cleanup script with your suggestion.
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
- Ed_P
- Contributor
- Posts: 8368
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
cleanup script copy update
BTW Where is this script located guys? I'd like to make the change in my 3.2.2 system.
Ed
- abelM
- 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
Hello brokenman. Thank you for your quick answer!
Regards,
Regards,
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
cleanup script copy update
The script is located inside initrd.xz. It's called cleanup.
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
- Ed_P
- Contributor
- Posts: 8368
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
cleanup script copy update
Thank you brokenman. I think I will wait for the fix in the next release.
But I may look into this initrd.xz file now though. Never done that before.
But I may look into this initrd.xz file now though. Never done that before.
Ed
- Ed_P
- Contributor
- Posts: 8368
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
cleanup script copy update
Interesting. Cleanup is in my /mnt/live folder!! So I can update it without rebuilding the ISO.
Ed
- abelM
- 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
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,
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,
- abelM
- 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
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. The bad news is I've messed up myself playing around with different persistent devices. Please tell me!!!
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. The bad news is I've messed up myself playing around with different persistent devices. Please tell me!!!
- abelM
- 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
Hi brokenman,
I'd like to know what you think about this stuff. Regards
I'd like to know what you think about this stuff. Regards
- Ed_P
- Contributor
- Posts: 8368
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
cleanup script copy update
Wow!! I'm glad one of us checked that aspect of the change.
You are correct abelM.
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 It works and the access rights of the cleanup file do not change.
Very strange that your cleanup change results in changes not being saved. And no error msg to indicate that or why.
You are correct abelM.
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
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:~$
Ed
- abelM
- 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
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.
- Ed_P
- Contributor
- Posts: 8368
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
cleanup script copy update
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:~$
Ed