Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24

Thread: (Browser: Brave) backup

  1. #11
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    21,623
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: (Browser: Brave) backup

    If all you want is a web browser, there are much better distros which will be 100x faster than Ubuntu. Less code, means less risk. Heck, because those other browser-centric distros are so very small, you could download a fresh one every week to remain patched in less than 1 minute.

    TinyCore with the browser is 16MB last time I checked. If you want/need libreoffice, I think that variant is 64MB. It runs from RAM. Ain't nuthin' faster.

    If you need more than a simple browser, there are ChromiumOS distros. These are like ChromeOS (aka Chromebooks), just with most of the google stuff removed and easier access to local storage while still being almost as secure. An old laptop from 2010 would fly with that OS. https://www.electromaker.io/blog/art...ome-os-is-best has a few comparisons. There is a Raspberry Pi v4 image - I bet that flies.

    I've used TinyCore for online banking for about a decade. I had to do something for my corporate accounts to ensure we didn't get our accounts hacked and have payroll stolen. Brian Krebs recommends running any online banking from read-only Linux storage. https://krebsonsecurity.com/online-b...or-businesses/

  2. #12
    Join Date
    May 2010
    Beans
    786

    Lightbulb Re: (Browser: Brave) backup

    Quote Originally Posted by TheFu View Post
    Code:
    $(date +\%Y\%m\%d)
    is the same as
    Code:
    $(date "+%F")
    Potato - tomato.
    As a professional software developer, I learned long ago to use the fewest characters possible. Less risk and we are less likely to confuse %m and %M which would be minute/month.


    isn't clear enough to respond. Getting different results is easy, just depends on what sort of different results are wanted.
    No worries dude. Just didn't see it in your original script

  3. #13
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    21,623
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: (Browser: Brave) backup

    Quote Originally Posted by ActionParsnip View Post
    No worries dude. Just didn't see it in your original script
    It isn't needed in the original script. rdiff-backup handles backup-set versioning for us.
    That's the difference between a backup tool and rsync.

    I wouldn't use rsync directly. There are plenty of rsync+hardlink scripts out there. Remember seeing my first around 1994 in a UNIX Power Tools book. That script will still work today, BTW.
    Heck, rsnapshot is in the Ubuntu Repos! https://ubuntu.com/server/docs/tools-rsnapshot
    https://rsnapshot.org/
    http://www.mikerubel.org/computers/rsync_snapshots/

    There's also rbackup http://rbackup.lescigales.org/ That link shows the storage required when using rsync vs rsnapshot vs rdiff-backup. Summary:

    Suppose you need to backup 1,000 MySQL databases, and that you use a program like mysqldump to dump each sql database into a database.sql file. Now suppose you have to make such a backup every day, that each database grow by 8 kilobytes a day and that each former database is 1 megabyte. With rsync (or rsnapshot), each time a change is made to the database dump file, it will have to store a new complete copy of the file. With rdiff-backup, you only store differences between files as they appear (and differences are actually compressed by gzip by default).
    • In 1 week, you would need 7.97 GB of storage if you were using rsync / rsnapshot against 1.03 GB if you were using rdiff-backup / rbackup !
    • In 3 months, you would need 119.42 GB of storage if you were using rsync / rsnapshot against 1.66 GB if you were using rdiff-backup / rbackup !
    • In 1 year, you would need 864.24 GB of storage if you were using rsync / rsnapshot against 3.76 GB if you were using rdiff-backup / rbackup !
    That's why I use rdiff-backup. It turns out that rdiff-backup is actually faster than rsync too.

  4. #14
    Join Date
    Jan 2020
    Beans
    Hidden!

    Re: (Browser: Brave) backup

    I'm lost at how to actually just save this entire directory, could you help me out?

    How to copy
    ~.config/BraveSoftware/Brave-Browser
    to my other partition named Other/Linux/Brave

    And have it check for date of files and only copy the latest version and skip older once + when one file is removed from the new one remove the old one also.

    And how to do this with a executable file on linux: PopOs (systemd)? (by mouse click on file only)
    + a reverse method, that just copy's back the already copied files and folders from my Other partition back to the main drive in ~.config/BraveSoftware/Brave-Browser
    and have it all just replaced.

  5. #15
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    21,623
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: (Browser: Brave) backup

    Quote Originally Posted by ayudha View Post
    However this has been the case on windows, switched over sinds 2 months and learning, prehaps linux is different and what i just described isn't going to work, i dunno. Let me know if you think different okay
    So permissions and all, hmm not sure if i need it. do i?
    I've shown my backup method above, simplified. There are many reasons that making a clone isn't as useful, mainly because at restore time you can't just restore a clone onto new hardware and have it work. I suspect your skill level on Unix isn't sufficient to correct the few, tiny, issues that will happen. A backup that only works if you restore it to identical hardware is useless to me. If I can't install the backup to completely new hardware, 2000km away, what's the point? Should I have 3 different backup methods to support 3 different needs
    OR
    have 1 backup method that supports all the needs? My answer is the last option.

    Owner, group, permissions, ACLs, xattrs are all necessary for backups. Those are incomplete when the backup isn't run using sudo/root. Unix permissions and ownership stuff. If everything being backed up is owned by the same userid that is running the backup, then permissions can be retained. Most HOME directories for a power-user will have some files that are owned by root, however. Depending on the permissions, you may not get any copy/backup of those files at all.
    I did say there were technical reasons WHY I do backups the specific way I said above. It is your box. I'm trying to help you prevent issues. But perhaps learning the hard way is best. At some point, the restore won't do what you need, but it might mostly work. Perhaps that's fine for today.

    rsync can copy files or directories. It has multiple different options for deleting files that aren't in the SOURCE but exist in the TARGET to control when the deletion happens. If you don't care, just use --delete. For example:
    Code:
    $ /usr/bin/ionice /usr/bin/rsync -av --stats --progress --exclude **/.Trash* --exclude lost+found --delete /d/D1/ /d/b-D1/
    The trailing '/' matters with rsync.

    Your SOURCE is an absolute-path. Good. ~/ expands to /...... based on the HOME directory in the passwd DB for the current userid. If being run from the root crontab, this will fail to do what you intend, BTW.

    Your TARGET is a relative-path. BAD.

    The TARGET needs to be an absolute-path. That's one that begins with a '/'. If it doesn't, it is relative and dependent on the PWD which changes. Don't use relative paths in scripts, because usually break and only work in specific locations. Also, the TARGET directories need to be on Linux file systems; not NTFS or exFAT or FAT32.

    As for using a mouse, that's something I'm not qualified to help with. Sorry. I don't do that, since my backups are automated.
    rsync works the same on all Linux systems.

    Google "rsync examples" to see how to use it. There are some examples in these forums. The manpage is excellent too, but seeing 10-50 examples is useful to get a "feel".

    But really, you should backup the entire HOME directory with just a few exceptions. No need for cache directories full of temporary files, right?

  6. #16
    Join Date
    Jan 2020
    Beans
    Hidden!

    Re: (Browser: Brave) backup

    Owner, group, permissions, ACLs, xattrs are all necessary for backups. Those are incomplete when the backup isn't run using sudo/root. Unix permissions and ownership stuff. If everything being backed up is owned by the same userid that is running the backup, then permissions can be retained. Most HOME directories for a power-user will have some files that are owned by root, however. Depending on the permissions, you may not get any copy/backup of those files at all.
    I did say there were technical reasons WHY I do backups the specific way I said above. It is your box. I'm trying to help you prevent issues. But perhaps learning the hard way is best. At some point, the restore won't do what you need, but it might mostly work. Perhaps that's fine for today.
    For a long time i have just been unhiding files and folders, going to the directory and then copied the folder manually to the place i would want it to and then later i could reinstall my system and browse to that same directory again and copy it back and it always works. I just want to automate the proces.

    But really, you should backup the entire HOME directory with just a few exceptions. No need for cache directories full of temporary files, right?
    Why i'm not doing that is because i think my reason of backup and restore is different. I think you want your current system saved entirely and when you go on some other system you want to use it right away. what i want is totally different.
    I have all of my stuff on a different partition and i see my main partition (linux) as a junk partition, i can install what i want, do what i want and once i find it slow ill restore my system as it was when i made the backup so its clean again. i dont care about all of the stuff i installed after this backup because i dont use software long term, i just have a basic linux install with what i need and i back it up and restore it when i want it. all i need to do is backup and restore a few files and im back on a 'clean' installed linux + my stuff. This i did manually (the last part) but now want to automate. And mostly it's just my browser files i want.

  7. #17
    Join Date
    Jan 2020
    Beans
    Hidden!

    Re: (Browser: Brave) backup

    So far i haven't managed to make anything work.

    Code:
    #!/bin/bash# Must run as root or with sudo; 
    
    
    SOURCE="/home/erik/.config/BraveSoftware"
    TARGET="/media/erik/Overige/Linux/Backup/"
    HOWMANY="7D"   # Retain backup versions for 90 days.
    
    
    /bin/mkdir  -p "$TARGET"
    
    
    /usr/bin/rdiff-backup  --exclude-special-files  "$SOURCE" "$TARGET"
    
    
    /usr/bin/rdiff-backup  --force  --remove-older-than  "$HOWMANY"    "$TARGET"
    
    
    echo "Backing up $SOURCE to $TARGET/$archive_file"
    date
    echo
    
    
    echo
    echo "Backup finished"
    How do you just copy this folder to the other folder and have it just copy the new and newer files?

  8. #18
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    21,623
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: (Browser: Brave) backup

    Exactly what is the error? If you are getting the same error as above still, did you install the rdiff-backup package yet?
    Code:
    sudo apt install rdiff-backup
    What does:
    Code:
    ls -al /media/erik/Overige/Linux/Backup    /home/erik/.config/BraveSoftware
    show?
    With using sudo, the source and target directories only need to exist and have sufficient storage. The error should say what problem, if any, there is.

    The first line breaks things here. This doesn't work:
    Code:
    #!/bin/bash# Must run as root or with sudo; 
    is a problem. Split it into 2 lines:
    Code:
    #!/bin/bash
    # Must run as root or with sudo;
    So, I tweaked the script a little and it worked:
    Code:
    $ sudo ~/bin/t-back 
    Sun Oct 25 10:14:20 EDT 2020
    Backing up /etc to /tmp/etc//
    /usr/bin/rdiff-backup --exclude-special-files /etc /tmp/etc/
    No increments older than Sun Oct 18 10:14:22 2020 found, exiting.
    Sun Oct 25 10:14:22 EDT 2020
    Backup finished
    
    $ sudo rdiff-backup --list-increment-sizes /tmp/etc/
            Time                       Size        Cumulative size
    -----------------------------------------------------------------------------
    Sun Oct 25 10:15:23 2020         11.2 MB           11.2 MB   (current mirror)
    I modified the /etc/hosts file slightly (added a space) and reran the backup:
    Code:
    $ sudo ~/bin/t-back 
    Sun Oct 25 10:17:21 EDT 2020
    Backing up /etc to /tmp/etc//
    /usr/bin/rdiff-backup --exclude-special-files /etc /tmp/etc/
    No increments older than Sun Oct 18 10:17:24 2020 found, exiting.
    Sun Oct 25 10:17:24 EDT 2020
    Backup finished
    
    $ sudo rdiff-backup --list-increment-sizes /tmp/etc/
            Time                       Size        Cumulative size
    -----------------------------------------------------------------------------
    Sun Oct 25 10:17:21 2020         11.2 MB           11.2 MB   (current mirror)
    Sun Oct 25 10:15:23 2020       123 bytes           11.2 MB
    Here's the script:
    Code:
    $ more ~/bin/t-back 
    #!/bin/bash
    # Must run as root or with sudo; 
    SOURCE="/etc"
    TARGET="/tmp/etc/"
    HOWMANY="7D"   # Retain backup versions for 90 days.
    
    /bin/mkdir  -p "$TARGET"
    
    date
    echo "Backing up $SOURCE to $TARGET/$archive_file"
    echo /usr/bin/rdiff-backup  --exclude-special-files  "$SOURCE" "$TARGET"
    /usr/bin/rdiff-backup  --exclude-special-files  "$SOURCE" "$TARGET"
    
    /usr/bin/rdiff-backup  --force  --remove-older-than  "$HOWMANY"    "$TARGET"
    date
    
    echo "Backup finished"
    Seems to be working as expected.
    Last edited by TheFu; 4 Weeks Ago at 03:18 PM.

  9. #19
    Join Date
    Jan 2020
    Beans
    Hidden!

    Re: (Browser: Brave) backup

    I have not installed it, i am seeking a way to do it without installing anything.

    It shows:
    Code:
    total 12drwx------  3 erik erik 4096 okt 25 07:07 .
    drwxr-xr-x 20 erik erik 4096 okt 25 10:11 ..
    drwx------ 34 erik erik 4096 okt 25 15:44 Brave-Browser
    
    
    /media/erik/Overige/Linux/Backup:
    total 8
    drwxrwxr-x 2 erik erik 4096 okt 25 11:55 .
    drwxrwxr-x 6 erik erik 4096 okt 25 14:35 ..

  10. #20
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    21,623
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: (Browser: Brave) backup

    Quote Originally Posted by ayudha View Post
    I have not installed it, i am seeking a way to do it without installing anything.
    Good luck with that. These tools are in the Canonical repos just like the kernels are.

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •