bbprofile Backup Browser Profile

Here is a place for your projects which are not officially supported by the Porteus Team. For example: your own kernel patched with extra features; desktops not included in the standard ISO like Gnome; base modules that are different than the standard ISO, etc...
User avatar
M. Eerie
Moderator
Moderator
Posts: 618
Joined: 31 Aug 2017, 21:18
Distribution: Nemesis Xfce/MATE x64

bbprofile Backup Browser Profile

Post#46 by M. Eerie » 24 Oct 2021, 11:21

raja wrote: ↑
24 Oct 2021, 11:06
execute the script in root mode
If executed in root mode, then the target profile will be searched under /root/.mozilla folder and a normal user would end with an empty profile...

Are you using guest or root account?
> 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

raja
Shogun
Shogun
Posts: 434
Joined: 02 May 2017, 09:51
Distribution: v3.2.2-32 and Porteus-Artix-64
Location: Chennai,India

bbprofile Backup Browser Profile

Post#47 by raja » 24 Oct 2021, 18:01

I am in user 'guest' mode. But,execute browser-profile.sh in terminal in 'root' mode.

As I said earlier, I extracted the profile module checked for permissions on 009profile,home and guest folders.

First two folders have root:root
Third one has guest:users.
So,the created module will work without interfering in boot process.

your script used by me..

Code: Select all

#!/bin/bash
#
# bbprofile: Saves your browser profile into a .xzm module in your Desktop directory
# 
#

usage() {
  echo "Usage: `basename $0` <browser>" >&2
  echo 'Supported Browsers: firefox | opera | vilvaldi | chromium | chrome'
  exit 1
}

# (LOCATION OF BROWSER PROFILES AS OF 2020-05)
profile=
case $1  in
    firefox)
    profile=/home/guest/.mozilla 
    ;;
    opera|vivaldi|chromium)
    profile=/home/guest/.config/$1
    ;;
    chrome)
    profile=/home/guest/.config/google-chrome
    ;;

    *) usage ;;
esac

target=`mktemp -d` && mkdir -p $target$profile || exit
excludeopts=
read -p "Exclude caches, backups, storage and reports (crashes,dumps...) ? [yY / ] "
echo
[[ $REPLY =~ ^[Yy]$ ]] && excludeopts="--exclude=Cache --exclude *backups --exclude *storage --exclude *rash* --exclude *dumps --exclude *report"

rsync -av --delete-before --exclude=lock $excludeopts $profile/ $target$profile
profile=009-profile-$1-$(date +%Y%m%d-%H%M).xzm
cd $target && sudo chown -R 1000:100 home/guest && cd -
mksquashfs $target/home $target/$profile -b 1M -comp xz -Xbcj x86 -noappend -keep-as-directory
mv $target/$profile $(xdg-user-dir DESKTOP)
rsync -a --delete `mktemp -d`/ $target

echo
echo "Your profile module is saved in" $(xdg-user-dir DESKTOP)/$profile
read -p "Would you like to copy it into your $PORTDIR/modules folder? [yY / ] "
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]
 then
 echo "Module not copied"
else
 cp -a $(xdg-user-dir DESKTOP)/$profile $PORTDIR/modules && echo "Module copied and ready to be activated at next boot"
fi

exit
cheers
Linux Kernel-4.4.272 -32 bit; Linux Kernel-5.4.185 - 64 bit

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

bbprofile Backup Browser Profile

Post#48 by M. Eerie » 25 Oct 2021, 21:29

raja wrote: ↑
24 Oct 2021, 18:01
your script used by me..
This is going to work only if the user is named 'guest'... And it is the older version. Have reworked the script and tested. Added more exclude options as well.

Code: Select all

#!/bin/bash
#
# bbprofile: Saves your browser profile into a .xzm module
# 

display_usage() {
  echo "Usage: "${0##*/}" <browser>" >&2
  echo -e 'Supported Browsers: \n\t -f (firefox)\n\t -o (opera)\n\t -v (vilvaldi)\n\t -u (chromium)\n\t -c (chrome)'
  exit 1
}

[[ $# -eq 1 ]] || display_usage

# (LOCATION OF BROWSER PROFILES AS OF 2020-05)
profile=
case $1  in
    firefox|-f) profile=.mozilla; brw="firefox" ;;
    opera|-o)  profile=.config/opera; brw="opera" ;;
    vivaldi|-v) profile=.config/vivaldi; brw="vivaldi" ;;
    chromium|-u) profile=.config/chromium; brw="chromium" ;;
    chrome|-c) profile=.config/google-chrome brw="chrome" ;;
    *) display_usage ;;
esac

eval {target,blank}="$(mktemp -d)" && mkdir -p $target$HOME || exit
excludeopts=
read -p "Exclude caches, backups, storage and reports (crashes,dumps...) ? [y/n] "
echo
[[ ${REPLY,,} =~ ^(yes|y)$ ]] && excludeopts="--exclude Cache --exclude data.safe.bin --exclude *backups --exclude *storage --exclude *rash* --exclude *dumps --exclude *report*"

rsync -avR --delete-before --exclude=lock $excludeopts $HOME/$profile/ $target
profile=009-profile-"$brw"-$(date +%Y%m%d-%H%M).xzm

[ -z "${HOME%/*}" ] || sudo chown 0.0 $target/home ### FIXED
### if you want .zstd compression, use the following line
### mksquashfs $target"${HOME::5}" /tmp/$profile -b 1M -comp zstd -Xcompression-level 22 -noappend -keep-as-directory
### instead of the next one:
mksquashfs $target"${HOME::5}" /tmp/$profile -b 1M -comp xz -Xbcj x86 -noappend -keep-as-directory

echo
echo "Your profile module was saved in" /tmp/$profile
read -p "Would you like to copy it into your $PORTDIR/modules folder? [y/n] "
echo
if [[ ${REPLY,,} =~ ^(yes|y)$ ]]; then
    cp -a /tmp/$profile $PORTDIR/modules 2> /dev/null
    echo "Module copied and ready to be activated at next boot"
  else echo "Module not copied in $PORTDIR/modules"
fi

sudo rsync -a --delete $blank/ $target && rmdir $target $blank && unset target blank profile brw excludeopts
exit
Last edited by M. Eerie on 26 Oct 2021, 09:17, edited 1 time in total.
> 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

Jack
Contributor
Contributor
Posts: 1857
Joined: 09 Aug 2013, 14:25
Distribution: Porteus and Nemesis
Location: USA

bbprofile Backup Browser Profile

Post#49 by Jack » 26 Oct 2021, 03:38

Here is my output of 2 ways

Way 1

Code: Select all

[2603-6010-ce02-3a4a-995e-5aa2-967f-a697 guest]# sh bbprofile.sh firefox
Exclude caches, backups, storage and reports (crashes,dumps...) ? [yY / ] Y

building file list ... done
./
extensions/
firefox/
firefox/installs.ini
firefox/profiles.ini
firefox/Pending Pings/
firefox/rk8leghn.default-release/
firefox/rk8leghn.default-release/.parentlock
firefox/rk8leghn.default-release/AlternateServices.txt
firefox/rk8leghn.default-release/SiteSecurityServiceState.txt
firefox/rk8leghn.default-release/addonStartup.json.lz4
firefox/rk8leghn.default-release/addons.json
firefox/rk8leghn.default-release/broadcast-listeners.json
firefox/rk8leghn.default-release/cert9.db
firefox/rk8leghn.default-release/compatibility.ini
firefox/rk8leghn.default-release/containers.json
firefox/rk8leghn.default-release/content-prefs.sqlite
firefox/rk8leghn.default-release/cookies.sqlite
firefox/rk8leghn.default-release/cookies.sqlite-wal
firefox/rk8leghn.default-release/extension-preferences.json
firefox/rk8leghn.default-release/extensions.json
firefox/rk8leghn.default-release/favicons.sqlite
firefox/rk8leghn.default-release/favicons.sqlite-wal
firefox/rk8leghn.default-release/formhistory.sqlite
firefox/rk8leghn.default-release/handlers.json
firefox/rk8leghn.default-release/key4.db
firefox/rk8leghn.default-release/logins-backup.json
firefox/rk8leghn.default-release/logins.json
firefox/rk8leghn.default-release/permissions.sqlite
firefox/rk8leghn.default-release/pkcs11.txt
firefox/rk8leghn.default-release/places.sqlite
firefox/rk8leghn.default-release/places.sqlite-wal
firefox/rk8leghn.default-release/prefs.js
firefox/rk8leghn.default-release/protections.sqlite
firefox/rk8leghn.default-release/search.json.mozlz4
firefox/rk8leghn.default-release/sessionCheckpoints.json
firefox/rk8leghn.default-release/shield-preference-experiments.json
firefox/rk8leghn.default-release/storage.sqlite
firefox/rk8leghn.default-release/times.json
firefox/rk8leghn.default-release/webappsstore.sqlite
firefox/rk8leghn.default-release/xulstore.json
firefox/rk8leghn.default-release/datareporting/
firefox/rk8leghn.default-release/datareporting/aborted-session-ping
firefox/rk8leghn.default-release/datareporting/session-state.json
firefox/rk8leghn.default-release/datareporting/state.json
firefox/rk8leghn.default-release/datareporting/archived/
firefox/rk8leghn.default-release/datareporting/archived/2021-10/
firefox/rk8leghn.default-release/datareporting/archived/2021-10/1635182883022.8bf9c6a6-64a0-46f3-95ef-399b9366ebc2.new-profile.jsonlz4
firefox/rk8leghn.default-release/datareporting/archived/2021-10/1635182883060.b77f5105-56f6-41bd-aa8f-3faf6ff1a245.event.jsonlz4
firefox/rk8leghn.default-release/datareporting/archived/2021-10/1635182883090.b5b25654-bd80-4fa6-adab-dfb7aa07910f.main.jsonlz4
firefox/rk8leghn.default-release/datareporting/archived/2021-10/1635182883101.f9545eb2-62be-41a2-8d3f-36faf1eef0f8.first-shutdown.jsonlz4
firefox/rk8leghn.default-release/datareporting/archived/2021-10/1635186732470.ed9c1c9b-db17-487d-b314-5298291e29ae.event.jsonlz4
firefox/rk8leghn.default-release/datareporting/archived/2021-10/1635193932470.86b6f522-684f-42db-a16f-f1d1feae9500.event.jsonlz4
firefox/rk8leghn.default-release/datareporting/glean/
firefox/rk8leghn.default-release/datareporting/glean/db/
firefox/rk8leghn.default-release/datareporting/glean/db/data.safe.bin
firefox/rk8leghn.default-release/datareporting/glean/events/
firefox/rk8leghn.default-release/datareporting/glean/pending_pings/
firefox/rk8leghn.default-release/datareporting/glean/tmp/
firefox/rk8leghn.default-release/features/
firefox/rk8leghn.default-release/features/{cb2bd469-3e46-4b77-ae3f-a2b878253112}/
firefox/rk8leghn.default-release/features/{cb2bd469-3e46-4b77-ae3f-a2b878253112}/addons-search-detection@mozilla.com.xpi
firefox/rk8leghn.default-release/features/{cb2bd469-3e46-4b77-ae3f-a2b878253112}/proxy-failover@mozilla.com.xpi
firefox/rk8leghn.default-release/features/{cb2bd469-3e46-4b77-ae3f-a2b878253112}/reset-search-defaults@mozilla.com.xpi
firefox/rk8leghn.default-release/gmp-gmpopenh264/
firefox/rk8leghn.default-release/gmp-gmpopenh264/1.8.1.1/
firefox/rk8leghn.default-release/gmp-gmpopenh264/1.8.1.1/gmpopenh264.info
firefox/rk8leghn.default-release/gmp-gmpopenh264/1.8.1.1/libgmpopenh264.so
firefox/rk8leghn.default-release/saved-telemetry-pings/
firefox/rk8leghn.default-release/security_state/
firefox/rk8leghn.default-release/security_state/data.safe.bin
firefox/v3eiu9ir.default/
firefox/v3eiu9ir.default/times.json

sent 22,840,309 bytes  received 1,083 bytes  45,682,784.00 bytes/sec
total size is 22,829,674  speedup is 1.00
/home/guest
Parallel mksquashfs: Using 2 processors
Creating 4.0 filesystem on /tmp/tmp.z7dRQc1UFi/009-profile-firefox-20211025-2322.xzm, block size 1048576.
[=================================================================-] 67/67 100%

Exportable Squashfs 4.0 filesystem, xz compressed, data block size 1048576
	compressed data, compressed metadata, compressed fragments,
	compressed xattrs, compressed ids
	duplicates are removed
Filesystem size 2707.16 Kbytes (2.64 Mbytes)
	12.14% of uncompressed filesystem size (22300.05 Kbytes)
Inode table size 874 bytes (0.85 Kbytes)
	34.77% of uncompressed inode table size (2514 bytes)
Directory table size 1330 bytes (1.30 Kbytes)
	58.77% of uncompressed directory table size (2263 bytes)
Number of duplicate files found 1
Number of inodes 76
Number of files 53
Number of fragments 4
Number of symbolic links 0
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 23
Number of ids (unique uids + gids) 3
Number of uids 2
	guest (1000)
	root (0)
Number of gids 2
	users (100)
	root (0)

Your profile module is saved in /root/Desktop/009-profile-firefox-20211025-2322.xzm
Would you like to copy it into your /mnt/sdb1/porteus/modules folder? [yY / ] Y

cp: cannot stat '/root/Desktop/009-profile-firefox-20211025-2322.xzm': Not a directory
[2603-6010-ce02-3a4a-995e-5aa2-967f-a697 guest]#
Way 2

Code: Select all

[2603-6010-ce02-3a4a-995e-5aa2-967f-a697 guest]# sh bbprofile.sh firefox
Exclude caches, backups, storage and reports (crashes,dumps...) ? [yY / ] 

building file list ... done
./
extensions/
firefox/
firefox/installs.ini
firefox/profiles.ini
firefox/Crash Reports/
firefox/Crash Reports/InstallTime20211004184504
firefox/Crash Reports/events/
firefox/Pending Pings/
firefox/rk8leghn.default-release/
firefox/rk8leghn.default-release/.parentlock
firefox/rk8leghn.default-release/AlternateServices.txt
firefox/rk8leghn.default-release/SiteSecurityServiceState.txt
firefox/rk8leghn.default-release/addonStartup.json.lz4
firefox/rk8leghn.default-release/addons.json
firefox/rk8leghn.default-release/broadcast-listeners.json
firefox/rk8leghn.default-release/cert9.db
firefox/rk8leghn.default-release/compatibility.ini
firefox/rk8leghn.default-release/containers.json
firefox/rk8leghn.default-release/content-prefs.sqlite
firefox/rk8leghn.default-release/cookies.sqlite
firefox/rk8leghn.default-release/cookies.sqlite-wal
firefox/rk8leghn.default-release/extension-preferences.json
firefox/rk8leghn.default-release/extensions.json
firefox/rk8leghn.default-release/favicons.sqlite
firefox/rk8leghn.default-release/favicons.sqlite-wal
firefox/rk8leghn.default-release/formhistory.sqlite
firefox/rk8leghn.default-release/handlers.json
firefox/rk8leghn.default-release/key4.db
firefox/rk8leghn.default-release/logins-backup.json
firefox/rk8leghn.default-release/logins.json
firefox/rk8leghn.default-release/permissions.sqlite
firefox/rk8leghn.default-release/pkcs11.txt
firefox/rk8leghn.default-release/places.sqlite
firefox/rk8leghn.default-release/places.sqlite-wal
firefox/rk8leghn.default-release/prefs.js
firefox/rk8leghn.default-release/protections.sqlite
firefox/rk8leghn.default-release/search.json.mozlz4
firefox/rk8leghn.default-release/sessionCheckpoints.json
firefox/rk8leghn.default-release/shield-preference-experiments.json
firefox/rk8leghn.default-release/storage.sqlite
firefox/rk8leghn.default-release/times.json
firefox/rk8leghn.default-release/webappsstore.sqlite
firefox/rk8leghn.default-release/xulstore.json
firefox/rk8leghn.default-release/bookmarkbackups/
firefox/rk8leghn.default-release/bookmarkbackups/bookmarks-2021-10-25_11_YbSV9lETF9hO6raszZeT1Q==.jsonlz4
firefox/rk8leghn.default-release/crashes/
firefox/rk8leghn.default-release/crashes/store.json.mozlz4
firefox/rk8leghn.default-release/crashes/events/
firefox/rk8leghn.default-release/datareporting/
firefox/rk8leghn.default-release/datareporting/aborted-session-ping
firefox/rk8leghn.default-release/datareporting/session-state.json
firefox/rk8leghn.default-release/datareporting/state.json
firefox/rk8leghn.default-release/datareporting/archived/
firefox/rk8leghn.default-release/datareporting/archived/2021-10/
firefox/rk8leghn.default-release/datareporting/archived/2021-10/1635182883022.8bf9c6a6-64a0-46f3-95ef-399b9366ebc2.new-profile.jsonlz4
firefox/rk8leghn.default-release/datareporting/archived/2021-10/1635182883060.b77f5105-56f6-41bd-aa8f-3faf6ff1a245.event.jsonlz4
firefox/rk8leghn.default-release/datareporting/archived/2021-10/1635182883090.b5b25654-bd80-4fa6-adab-dfb7aa07910f.main.jsonlz4
firefox/rk8leghn.default-release/datareporting/archived/2021-10/1635182883101.f9545eb2-62be-41a2-8d3f-36faf1eef0f8.first-shutdown.jsonlz4
firefox/rk8leghn.default-release/datareporting/archived/2021-10/1635186732470.ed9c1c9b-db17-487d-b314-5298291e29ae.event.jsonlz4
firefox/rk8leghn.default-release/datareporting/archived/2021-10/1635193932470.86b6f522-684f-42db-a16f-f1d1feae9500.event.jsonlz4
firefox/rk8leghn.default-release/datareporting/glean/
firefox/rk8leghn.default-release/datareporting/glean/db/
firefox/rk8leghn.default-release/datareporting/glean/db/data.safe.bin
firefox/rk8leghn.default-release/datareporting/glean/events/
firefox/rk8leghn.default-release/datareporting/glean/pending_pings/
firefox/rk8leghn.default-release/datareporting/glean/tmp/
firefox/rk8leghn.default-release/features/
firefox/rk8leghn.default-release/features/{cb2bd469-3e46-4b77-ae3f-a2b878253112}/
firefox/rk8leghn.default-release/features/{cb2bd469-3e46-4b77-ae3f-a2b878253112}/addons-search-detection@mozilla.com.xpi
firefox/rk8leghn.default-release/features/{cb2bd469-3e46-4b77-ae3f-a2b878253112}/proxy-failover@mozilla.com.xpi
firefox/rk8leghn.default-release/features/{cb2bd469-3e46-4b77-ae3f-a2b878253112}/reset-search-defaults@mozilla.com.xpi
firefox/rk8leghn.default-release/gmp-gmpopenh264/
firefox/rk8leghn.default-release/gmp-gmpopenh264/1.8.1.1/
firefox/rk8leghn.default-release/gmp-gmpopenh264/1.8.1.1/gmpopenh264.info
firefox/rk8leghn.default-release/gmp-gmpopenh264/1.8.1.1/libgmpopenh264.so
firefox/rk8leghn.default-release/minidumps/
firefox/rk8leghn.default-release/saved-telemetry-pings/
firefox/rk8leghn.default-release/security_state/
firefox/rk8leghn.default-release/security_state/data.safe.bin
firefox/rk8leghn.default-release/sessionstore-backups/
firefox/rk8leghn.default-release/sessionstore-backups/previous.jsonlz4
firefox/rk8leghn.default-release/sessionstore-backups/recovery.baklz4
firefox/rk8leghn.default-release/sessionstore-backups/recovery.jsonlz4
firefox/rk8leghn.default-release/sessionstore-backups/upgrade.jsonlz4-20211004184504
firefox/rk8leghn.default-release/storage/
firefox/rk8leghn.default-release/storage/ls-archive.sqlite
firefox/rk8leghn.default-release/storage/default/
firefox/rk8leghn.default-release/storage/default/https+++www.google.com/
firefox/rk8leghn.default-release/storage/default/https+++www.google.com/.metadata-v2
firefox/rk8leghn.default-release/storage/default/https+++www.google.com/ls/
firefox/rk8leghn.default-release/storage/default/https+++www.google.com/ls/data.sqlite
firefox/rk8leghn.default-release/storage/default/https+++www.google.com/ls/usage
firefox/rk8leghn.default-release/storage/default/moz-extension+++1b469af3-1a20-45c9-9eb4-de368c2c1d58^userContextId=4294967295/
firefox/rk8leghn.default-release/storage/default/moz-extension+++1b469af3-1a20-45c9-9eb4-de368c2c1d58^userContextId=4294967295/.metadata-v2
firefox/rk8leghn.default-release/storage/default/moz-extension+++1b469af3-1a20-45c9-9eb4-de368c2c1d58^userContextId=4294967295/idb/
firefox/rk8leghn.default-release/storage/default/moz-extension+++1b469af3-1a20-45c9-9eb4-de368c2c1d58^userContextId=4294967295/idb/3647222921wleabcEoxlt-eengsairo.sqlite
firefox/rk8leghn.default-release/storage/default/moz-extension+++1b469af3-1a20-45c9-9eb4-de368c2c1d58^userContextId=4294967295/idb/3647222921wleabcEoxlt-eengsairo.files/
firefox/rk8leghn.default-release/storage/permanent/
firefox/rk8leghn.default-release/storage/permanent/chrome/
firefox/rk8leghn.default-release/storage/permanent/chrome/.metadata-v2
firefox/rk8leghn.default-release/storage/permanent/chrome/idb/
firefox/rk8leghn.default-release/storage/permanent/chrome/idb/1451318868ntouromlalnodry--epcr.sqlite
firefox/rk8leghn.default-release/storage/permanent/chrome/idb/1657114595AmcateirvtiSty.sqlite
firefox/rk8leghn.default-release/storage/permanent/chrome/idb/2823318777ntouromlalnodry--naod.sqlite
firefox/rk8leghn.default-release/storage/permanent/chrome/idb/2918063365piupsah.sqlite
firefox/rk8leghn.default-release/storage/permanent/chrome/idb/3561288849sdhlie.sqlite
firefox/rk8leghn.default-release/storage/permanent/chrome/idb/3870112724rsegmnoittet-es.sqlite
firefox/rk8leghn.default-release/storage/permanent/chrome/idb/1451318868ntouromlalnodry--epcr.files/
firefox/rk8leghn.default-release/storage/permanent/chrome/idb/1657114595AmcateirvtiSty.files/
firefox/rk8leghn.default-release/storage/permanent/chrome/idb/2823318777ntouromlalnodry--naod.files/
firefox/rk8leghn.default-release/storage/permanent/chrome/idb/2918063365piupsah.files/
firefox/rk8leghn.default-release/storage/permanent/chrome/idb/3561288849sdhlie.files/
firefox/rk8leghn.default-release/storage/permanent/chrome/idb/3870112724rsegmnoittet-es.files/
firefox/rk8leghn.default-release/storage/temporary/
firefox/v3eiu9ir.default/
firefox/v3eiu9ir.default/times.json

sent 37,975,738 bytes  received 1,535 bytes  75,954,546.00 bytes/sec
total size is 37,958,735  speedup is 1.00
/home/guest
Parallel mksquashfs: Using 2 processors
Creating 4.0 filesystem on /tmp/tmp.XIkpO8CiMM/009-profile-firefox-20211025-2315.xzm, block size 1048576.
[===============================================================|] 100/100 100%

Exportable Squashfs 4.0 filesystem, xz compressed, data block size 1048576
	compressed data, compressed metadata, compressed fragments,
	compressed xattrs, compressed ids
	duplicates are removed
Filesystem size 4524.73 Kbytes (4.42 Mbytes)
	12.20% of uncompressed filesystem size (37077.70 Kbytes)
Inode table size 1246 bytes (1.22 Kbytes)
	31.32% of uncompressed inode table size (3978 bytes)
Directory table size 1954 bytes (1.91 Kbytes)
	53.14% of uncompressed directory table size (3677 bytes)
Number of duplicate files found 2
Number of inodes 120
Number of files 73
Number of fragments 5
Number of symbolic links 0
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 47
Number of ids (unique uids + gids) 3
Number of uids 2
	guest (1000)
	root (0)
Number of gids 2
	users (100)
	root (0)

Your profile module is saved in /root/Desktop/009-profile-firefox-20211025-2315.xzm
Would you like to copy it into your /mnt/sdb1/porteus/modules folder? [yY / ] 

Module not copied
[2603-6010-ce02-3a4a-995e-5aa2-967f-a697 guest]#
Whats wrong? Or it won't works in Nemesis Mate?
I just like Slackware because I think it teach you about Linux to build packages where Ubuntu is like Windows you just install programs you want.

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

bbprofile Backup Browser Profile

Post#50 by M. Eerie » 26 Oct 2021, 06:27

Jack wrote: ↑
26 Oct 2021, 03:38
Whats wrong? Or it won't works in Nemesis Mate?
The script is agnostic. It doesn't matter if run under any DE or distro. Althought is intended to support 5 browsers, it's clearly focused in Firefox, as there has not been reports from the other browsers. Maybe @raja can tell about opera and vivaldi.
Jack wrote: ↑
26 Oct 2021, 03:38

Code: Select all

[2603-6010-ce02-3a4a-995e-5aa2-967f-a697 guest]#
Firstly, DON'T run as 'su' in guest account as it will fail. If you intend to use Firefox under root account, then login as root and execute the script (the updated one) normally.

Assuming the 'Way 1' is the older script, it has been discussed in the thread. A bug has been reported where by activating the created profile module, the administrative tasks (i.e. psu caja) will be disabled. I think, you even reported that.

So I've fixed and updated the script. Please update yours and whether you login as guest or as root, don't run as 'su'.

Thanks.
> 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
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

bbprofile Backup Browser Profile

Post#51 by Rava » 12 Sep 2022, 11:44

M. Eerie wrote: ↑
01 May 2020, 15:18
echo 'Supported Browsers: firefox | opera | vilvaldi | chromium | chrome'
Are you interested in adding Palemoon to the mix?
its profile is usually at
"~/.moonchild productions/pale moon/RANDOM.default/" (yes it uses two white spaces in its paths) and defined via "~/.moonchild productions/pale moon/profiles.ini"

The basic handling of the profile should be very similar to firefox since palemooon is a firefox fork.

my profiles.ini looks like this

Code: Select all

[General]
StartWithLastProfile=1

[Profile0]
Name=default
IsRelative=1
Path=RANDOM.default
RANDOM of course is some random alphanumeric string, like b15abc7 or such.
Cheers!
Yours Rava

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

bbprofile Backup Browser Profile

Post#52 by M. Eerie » 12 Sep 2022, 12:37

Rava wrote: ↑
12 Sep 2022, 11:44
Are you interested in adding Palemoon to the mix?
I'm in a hurry. Can you test it?

Code: Select all

#!/usr/bin/env bash
#
# bbprofile: Saves your browser profile into a module
#

display_usage() {
  echo "Usage: "${0##*/}" <browser>" >&2
  echo -e "Supported Browsers: \n\t firefox\n\t palemoon\n\t opera\n\t vilvaldi\n\t chromium\n\t chrome"
  exit 1
}

[[ $# -eq 1 ]] || display_usage

brcfg=
# (LOCATION OF BROWSER PROFILES AS OF 2020-05)
case "$1" in
    firefox) brcfg=.mozilla ;;
    palemoon) brcfg=".moonchild productions";;
    opera)  brcfg=".config/opera" ;;
    vivaldi) brcfg=".config/vivaldi" ;;
    chromium) brcfg=".config/chromium" ;;
    chrome) brcfg=".config/google-chrome" ;;
    *) display_usage ;;
esac

excludeopts="--exclude Cache --exclude data.safe.bin --exclude *backups --exclude *storage --exclude *rash* --exclude *dumps --exclude *report*"
read -n 1 -p "Exclude caches, backups, storage and reports (crashes,dumps...)? [y/*] "
echo
[[ ${REPLY,,} == y ]] || excludeopts=""

eval {X,empty}="$(mktemp -d)"; chmod 755 $X $empty
mkdir -p $X$HOME || exit
rsync -avR --delete-before --exclude=lock $excludeopts "$HOME/$brcfg/" "$X"
[ $EUID -eq 0 ] || sudo chown 0:0 $X/home ### FIXED [ -z "${HOME%/*}" ]
brcfg="009-$1-profile-$(date +%Y%m%d-%H%M)."

comp=" -b 1M -comp xz -Xbcj x86 -noappend"
read -n3 -p "Compression method? [xzm/zst] "
echo
[[ ${REPLY,,} == xzm ]] || comp=" -b 1M -comp zstd -Xcompression-level 22 -noappend"

mksquashfs $X /tmp/$brcfg$REPLY $comp ### $X"${HOME::5}"

echo
echo "Your profile module was saved in" /tmp/$brcfg
read -n 1 -p "Would you like to copy it into your $PORTDIR/modules folder? [y/n] "
echo
if [[ ${REPLY,,} == y ]]; then
    cp -a /tmp/$brcfg $PORTDIR/modules 2> /dev/null
    tput bold;tput setaf 2; echo "Module copied and ready to be activated at next boot"
  else tput bold;tput setaf 1; echo "Module not copied into $PORTDIR/modules"
fi
sleep 2
Last edited by M. Eerie on 13 Sep 2022, 10:27, edited 3 times in total.
> 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
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

bbprofile Backup Browser Profile

Post#53 by Rava » 12 Sep 2022, 12:52

For now the handling of the whitespaces fails:

Code: Select all

guest@porteus:/mybin/linux$ ./porteus/bbprofile.sh palemoon
Exclude caches, backups, storage and reports (crashes,dumps...)? [y/*] y
building file list ... 
rsync: [sender] link_stat "/home/guest/.moonchild" failed: No such file or directory (2)
rsync: [sender] link_stat "/mybin/linux/productions" failed: No such file or directory (2)
done
Looks like some lines need "" …
Cheers!
Yours Rava

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

bbprofile Backup Browser Profile

Post#54 by M. Eerie » 12 Sep 2022, 19:55

Rava wrote: ↑
12 Sep 2022, 12:52
For now the handling of the whitespaces fails:
So, brcfg variable needs to be enclosed in "".

Try now (I'm not a palemoon user)
> 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
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

bbprofile Backup Browser Profile

Post#55 by Rava » 13 Sep 2022, 00:04

M. Eerie wrote: ↑
12 Sep 2022, 19:55
So, brcfg variable needs to be enclosed in "".

Try now (I'm not a palemoon user)

Code: Select all

guest@porteus:~$ diff /mybin/linux/porteus/bbprofile*
33c33
< rsync -avR --delete-before --exclude=lock $excludeopts $HOME/$brcfg/ $X
---
> rsync -avR --delete-before --exclude=lock $excludeopts "$HOME/$brcfg/" "$X"
guest@porteus:~$ /mybin/linux/porteus/bbprofile2.sh  palemoon
Exclude caches, backups, storage and reports (crashes,dumps...)? [y/*] y
building file list ... done
/home/
/home/guest/
/home/guest/.moonchild productions/
/home/guest/.moonchild productions/pale moon/
/home/guest/.moonchild productions/pale moon/profiles.ini
/home/guest/.moonchild productions/pale moon/n01gre3s.default/
/home/guest/.moonchild productions/pale moon/n01gre3s.default/.parentlock
[…]
/home/guest/.moonchild productions/pale moon/n01gre3s.default/searchplugins/dictcc-deen.xml
/home/guest/.moonchild productions/pale moon/n01gre3s.default/searchplugins/leo-de-en.xml

sent 50,363,950 bytes  received 1,975 bytes  100,731,850.00 bytes/sec
total size is 50,344,130  speedup is 1.00

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things: :friends: 

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

Password: 
Compression method? [xzm/zst] xzm
Parallel mksquashfs: Using 8 processors
Creating 4.0 filesystem on /tmp/009-palemoon-profile-20220913-0135.xzm, block size 1048576.
[===============================================================-] 133/133 100%
[…]

Your profile module was saved in /tmp/009-palemoon-profile-20220913-0135.xzm
Would you like to copy it into your /mnt/sda1/Porteus_5.0/porteus/modules folder? [y/n] n
Module not copied in /mnt/sda1/Porteus_5.0/porteus/modules

Code: Select all

lsxzm /tmp/009-palemoon-profile-20220913-0135.xzm
looks good as far as I can tell.

Needs one more change:

Code: Select all

guest@porteus:~$ diff /mybin/linux/porteus/bbprofile[23]*
8c8
<   echo -e 'Supported Browsers: \n\t firefox\n\t opera\n\t vilvaldi\n\t chromium\n\t chrome'
---
>   echo -e 'Supported Browsers: \n\t firefox\n\t palemoon\n\t opera\n\t vilvaldi\n\t chromium\n\t chrome'
guest@porteus:~$ /mybin/linux/porteus/bbprofile2.sh 
Usage: bbprofile2.sh <browser>
Supported Browsers: 
	 firefox
	 opera
	 vilvaldi
	 chromium
	 chrome
guest@porteus:~$ /mybin/linux/porteus/bbprofile3.sh 
Usage: bbprofile3.sh <browser>
Supported Browsers: 
	 firefox
	 palemoon
	 opera
	 vilvaldi
	 chromium
	 chrome
:friends:

Added in 5 minutes 34 seconds:
Additionally I suggest this small adjustment - either

Code: Select all

guest@porteus:/mybin/linux/porteus$ diff bbprofile3.sh bbprofile4.sh
51c51
<   else tput bold;tput setaf 1; echo "Module not copied in $PORTDIR/modules"
---
>   else tput bold;tput setaf 1; echo "Module not copied into $PORTDIR/modules"
or

Code: Select all

guest@porteus:/mybin/linux/porteus$ diff bbprofile3.sh bbprofile5.sh 
51c51
<   else tput bold;tput setaf 1; echo "Module not copied in $PORTDIR/modules"
---
>   else tput bold;tput setaf 1; echo "Module not copied to $PORTDIR/modules"
:)
Cheers!
Yours Rava

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

bbprofile Backup Browser Profile

Post#56 by M. Eerie » 13 Sep 2022, 10:29

Rava wrote: ↑
13 Sep 2022, 00:09
Needs one more change:
Changes applied :)

Also fixed the optional compression method.

@Ed_P
Would you mind to update the first post with the updated script ( again? ) :)
> 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
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

bbprofile Backup Browser Profile

Post#57 by Rava » 13 Sep 2022, 12:40

M. Eerie wrote: ↑
13 Sep 2022, 10:29
@Ed_P
Would you mind to update the first post with the updated script ( again? ) :)
I have done that for you, and I also added
M. Eerie wrote: ↑
01 May 2020, 15:18
Invoke as guest:
(no highlighting in the original post)
Also added the reason for editing
Reason: updated to version 2022-09-13
Cheers!
Yours Rava

Kulle
Warlord
Warlord
Posts: 594
Joined: 28 Jan 2017, 10:39
Distribution: v4.0 64bit Xfce
Location: Berlin

bbprofile Backup Browser Profile

Post#58 by Kulle » 13 Sep 2022, 12:47

Hi M. Eerie,
the Chromium configuration (the chromium folder) is in /home/guest/.config
I created a module from this chromium folder via dir2xzm
That's how I've done it in the past. Module size: 50.6 MiB

Now I tried your script (#1above)
It worked well:
Module 009-chromium-profile-20220913-1212.xzm
Size: 36.6 MiB
I can't explain the size difference ?!

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

bbprofile Backup Browser Profile

Post#59 by M. Eerie » 13 Sep 2022, 16:23

Kulle wrote: ↑
13 Sep 2022, 12:47
I can't explain the size difference ?!
Hi Kulle.

The profile folder holds lots of temporary stuff... Then, you probably answered "y" to the question:

"Exclude caches, backups, storage and reports (crashes,dumps...)? [y/*] "

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

rych
Warlord
Warlord
Posts: 622
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

bbprofile Backup Browser Profile

Post#60 by rych » 14 Sep 2022, 09:59

I have a one-liner that does it for me in an exit script, notice no need to copy folders etc. when using the full path information with -no-strip: the module will expand back into the correct path then,

Code: Select all

COMP_ZSTD="-comp zstd -b 256K"
mksquashfs $HOME/.mozilla/firefox/FirefoxProfile $PORTDIR/modules/fp.xzm $COMP_ZSTD -noappend -no-strip
As for exclusions, we can use -e (optionally with -wildcards) or -ef parameter to the mksquashfs. The Cache should already be a symbolic link pointing to a temporary location.

I don't use -Xcompression-level 22 in my COMP_ZSTD anymore as it leads to only a 10% reduction in size with a much slower compression. Exit scripts should run reasonably quickly as I usually must leave in a hurry
Last edited by rych on 14 Sep 2022, 15:18, edited 7 times in total.

Post Reply