Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: (Browser: Brave) backup

  1. #1
    Join Date
    Jan 2020
    Beans
    Hidden!

    (Browser: Brave) backup

    Does anyone know how to make backups from certain files in the background every day?
    I am using a chromium based browser named Brave and i would like to have my bookmarks, extension settings, certain cookies, flags and all settings saved in a folder on my other partition.

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    21,702
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: (Browser: Brave) backup

    All settings are stored in the HOME directory for each userid, somewhere. Usually in ~/.config/{program name}/

    It is likely those specific things and others are there too. Really, backing up your HOME daily is a basic Linux skill needed by everyone. However, the backups need to be placed on different physical storage, not just in a different folder or partition on the same drive. It is also best if that other storage has a Linux file system on it so permissions, ACLs are retained, so don't use NTFS or exFAT or vFAT or FAT32 storage.

    Simple script for versioned backups of all HOME directories to $TARGET storage.

    Code:
    #!/bin/bash
    # ##################################
    # Simple /home/ backup script
    # Must run as root or with sudo; best to use root's crontab
    # ##################################
    
    SOURCE="/home"    # What to be backed up
    TARGET=/mnt/Backups/$HOSTNAME    # Where to write the versioned backups
    HOWMANY="90D"   # Retain backup versions for 90 days.
    # Change to less or more, as needed
    # May want to mount storage at this point in the script
    
    # Ensure the target location exists. Best if this has a different HDD
    # mounted to /mnt/Backups/
    #   Do not use NTFS or FAT32 or vFAT or exFAT storage.  Use native,
    #   linux, storage like ext4, xfs, f2fs 
    #    which supports full Linux permissions.
    /bin/mkdir  -p "$TARGET"
    
    # Do the verioned backup
    /usr/bin/rdiff-backup  --exclude-special-files  "$SOURCE" "$TARGET"
    
    # Remove the old backups 
    /usr/bin/rdiff-backup  --force  --remove-older-than  "$HOWMANY"    "$TARGET"
    
    # May want to umount storage here

    1. I'd create this file as /root/bin/backup-home.sh, then
    2. chmod 700 /root/bin/backup-home.sh it and
    3. setup root's crontab to run it daily, perhaps at noon (when at lunch or midnight or 6am).

    If you choose NOT to setup in this way, then you are on your own. This script expects to be run from a root crontab, automatically, daily or weekly.
    If you don't know how to setup scripts - stop. Go learn that skill.
    If you don't know how to setup one of the root crontabs to run a script automatically - stop. Go learn that skill. There are a few different places for a script to be run by root. I don't think it matters which you use. I'd probably use crontab -e, but I want complete control over the start time of the script. If you aren't picky and are willing for some corrupted files in the backups and having a really slow system when the backups happen "sometime" that day, then /etc/cron.daily/ would be fine for this script's location instead of /root/bin/. There's a /etc/cron.weekly/ directory that has scripts which get run ... er ... weekly, sometime. You are the admin of your system, not me.

    May want to add a few little things to the script, but that's the basic solution. Some other items for consideration:
    • I'd either delete the browser cache and "local objects" created by Flash and HTML5 or just use the --exclude "**/cache" option to exclude those regardless of where they are located.
    • I'd gather a list of manually installed programs just before running the backup tool (apt-mark showmanual) and store that list in my HOME somewhere that gets backed-up. Then should you ever need to move everything to a fresh machine, fresh install, you can restore your HOME, then feed that list of manually installed programs into APT and have those installed in just a few minutes with minimal hassle.
    • May want to backup selected files in /etc/ which you've modified too. I grab the entire directory structure, but usually only need to restore about 15 specific config files. It is pretty small, so having the entire area backed up is less than 1 second and just a few MB of storage.


    The first run will take as much time as copying all the data requires. But after that, only changed files would be copied. Usually for my systems, backups take between 1-8 minutes for each system. It depends more on the change data and the total number of files to check than anything else. For a system with 500K files, it takes longer. My Plex Media Server usually takes about 80-90 minutes due to all the tiny metadata files that Plex creates. Because it is plex and not exactly a critical system, I don't back it up daily - just twice a week. I do mirror the media files more often as they are added and removed. I decided long ago that media files don't need versioned backups, just a mirror and not a real-time mirror (not RAID1). If a disk fails today, I might lose 2 days of media files - oh well. For media files, I use rsync, but rsync is NOT sufficient for a real backup for many reasons. There are scripts around rsync to make a better backup solution from it, but rdiff-backup already handles those parts and is more time and more storage efficient while not using any funky proprietary backup file formats.

    Anyways, start simple and build on that is usually the best solution. Getting your HOME data is the minimum everyone should be doing for versioned backups.
    Last edited by TheFu; August 30th, 2020 at 05:01 PM. Reason: Some parts ARE NOT optional for this to work.

  3. #3
    Join Date
    Jan 2020
    Beans
    Hidden!

    Re: (Browser: Brave) backup

    OK got it. im trying to run it from my other partition not from root. i chmod it. then i run it and it says
    Code:
    line 21: /usr/bin/rdiff-backup: No such file or directoryand also on line 24
    This is what i have
    Code:
    #!/bin/bash# ##################################
    # Simple /home/ backup script
    # Must run as root or with sudo; best to use root's crontab
    # ##################################
    
    
    SOURCE="~/.config/BraveSoftware"    # What to be backed up
    TARGET=/media/erik/Overige/Linux/Backup/BraveSoftware    # Where to write the versioned backups (/mnt/Backups/@HOSTNAME
    HOWMANY="90D"   # Retain backup versions for 90 days.
    # Change to less or more, as needed
    # May want to mount storage at this point in the script
    
    
    # Ensure the target location exists. Best if this has a different HDD
    # mounted to /mnt/Backups/
    #   Do not use NTFS or FAT32 or vFAT or exFAT storage.  Use native,
    #   linux, storage like ext4, xfs, f2fs 
    #    which supports full Linux permissions.
    /bin/mkdir  -p "$TARGET"
    
    
    # Do the verioned backup
    /usr/bin/rdiff-backup  --exclude-special-files  "$SOURCE" "$TARGET"
    
    
    # Remove the old backups 
    /usr/bin/rdiff-backup  --force  --remove-older-than  "$HOWMANY"    "$TARGET"
    
    
    # May want to umount storage here
    I thought that "" was missing from target so i added that but still nothing.
    I can asure you target and source path is correct.

    And why would it be deleted aftet x days?

    Step 3 i don't understand.

    I also couldn't locate /usr/bin/rdiff-backup
    Last edited by ayudha; July 17th, 2020 at 06:16 PM.

  4. #4
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    21,702
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: (Browser: Brave) backup

    Quote Originally Posted by ayudha View Post
    I also couldn't locate /usr/bin/rdiff-backup
    Did you install it?

    Why delete old versions of the backups? So you don't fill up the target storage. Makes sense, right?

    What do you think is step 3? Backups need to run under the root account to maintain ownership, permissions, ACLs. The easiest way to accomplish that is by using the root crontab. This is how cron-jobs are scheduled, especially things we want to happen periodically. How to use cron would be a different question - and you should do your own research about that before asking questions so "some" background exists.

    The placement of this backup script file isn't random.
    Last edited by TheFu; July 17th, 2020 at 09:30 PM.

  5. #5
    Join Date
    Jan 2020
    Beans
    Hidden!

    Re: (Browser: Brave) backup

    I actually prefer to have it manually. Like a file i can press on that executes a script that copy's certain files for me to a certain other file and then closes. I was making this on windows before but now that i have stopped using that i would need one on linux but it's all so new for me. could you assist me?

  6. #6
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    21,702
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: (Browser: Brave) backup

    Quote Originally Posted by ayudha View Post
    I actually prefer to have it manually. Like a file i can press on that executes a script that copy's certain files for me to a certain other file and then closes. I was making this on windows before but now that i have stopped using that i would need one on linux but it's all so new for me. could you assist me?
    I cannot. I don't do it that way for many technical reasons. A backup of just the data is only 50% of what we need at restore time. We also need owner, group, permissions, ACLs, xattrs .... which is why nobody experienced says to just "copy the files".

  7. #7
    Join Date
    Jan 2020
    Beans
    Hidden!

    Re: (Browser: Brave) backup

    OK. that does make sense for linux.
    are there different options with different results?

  8. #8
    Join Date
    May 2010
    Beans
    806

    Re: (Browser: Brave) backup

    Could add the date to the backup

    Code:
    TARGET=/media/erik/Overige/Linux/Backup/BraveSoftware-$(date +\%Y\%m\%d)
    Or similar

  9. #9
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    21,702
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: (Browser: Brave) backup

    No need to add dates to backups. The tool handles that already.

    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.

    OK. that does make sense for linux.
    are there different options with different results?
    isn't clear enough to respond. Getting different results is easy, just depends on what sort of different results are wanted.
    Last edited by TheFu; August 29th, 2020 at 01:01 AM.

  10. #10
    Join Date
    Jan 2020
    Beans
    Hidden!

    Re: (Browser: Brave) backup

    Not sure how you do backup of files, ill give you my method.
    I do a clean install of linux, i make it like i want it and clean the system then i reboot into a program whereby i backup the entire partition (not clone).
    Everytime the system goes slow or something doesnt go right or just once in a while i put the backup back in 5 mins and have my original fresh install again.
    New software i actually never use all i do is brows the web so i just need to copy certain files and folders that Brave browser uses to save everything in and prehaps later some other things.
    Worked for years for me. Just need a running clean system and i'll keep it that way since i dont develop stuff or anything close to that. Just snooping around on the web.

    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?

Page 1 of 3 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
  •