There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

linux

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

JoelJ , in whats so good about arch compared to linux mint?

Just to chime in, I first tried arch because some youtuber I followed recommended it, but after 5 years I would say I’ve stayed with it for the AUR and the community. The AUR has almost every app I’ve ever needed, and whenever I have a problem there’s always a solution on one forum or another, to the point where I can usually just copy and paste it into the terminal and it’s solved!

dino ,

AUR is kind of the worst feature Arch offers and I am not actively using Arch right now anyway. Because its used for the wrong purpose: “install any app you need/want”. Thats dangerous and creates problems by itself. I’d rather rely on flatpak/appimages, but open for counter arguments.

RiikkaTheIcePrincess ,
@RiikkaTheIcePrincess@kbin.social avatar

So much this! As a user of both Arch and Gentoo I say, don't use Arch as Gentoo! It's not Gentoo! AUR is not a standard repository and there's a reason they make you jump through hoops just to use the thing.

Also, it's a total pain when normal package management is quick and easy. The building alone is weird in Arch and somehow like 60% of the crap I try to build from AUR fails hard and I just can't be bothered to spend more than like twenty minutes tweaking on it. Gr. 😅

(Aaalllsooo, apparently lots of people break their Arch installs using the AUR like it's a normal repo and then wonder why Arch is so crap and leave.)

warmaster , in whats so good about arch compared to linux mint?

I use Crystal Linux, which is Arch based.

I’ve tried Mint along with 10 other distros. What I liked about Arch is:

  • Latest Kernel, always. This means new drivers, better support for your current devices and support for more devices. Security & performance patches.
  • AUR. Massive repo of user submitted apps & libs most not found elsewhere.
  • Arch WiKi. Everything you will need or want to do somebody else already did and documented it so everyone else can have a guide to do it. Best documentation site ever.
  • Arch Repo. Always the latest Software. Officially maintained apps and libs land first on Arch, Debian & Ubuntu derivatives take ages to catch up in comparison.
floofloof ,

It’s great having so much software available but the AUR makes me nervous because you really don’t know who you’re trusting when you install something from there.

FreeBooteR69 ,
@FreeBooteR69@kbin.social avatar

That's why you are supposed to check the pkgbuild before installing anything from the aur.

warmaster ,

Flathub has hundreds of apps which are not sandboxed and untrustworthy. So, no source is safe, and even most “safe” apps are not protected from supply chain attacks. So, you always have to be careful. But I agree there are certainly degrees of safety, and the AUR is certainly another one, which should not be taken lightly.

AlmightySnoo , in whats so good about arch compared to linux mint?
@AlmightySnoo@lemmy.world avatar

Arch and Gentoo have IMO the best documentation ever and you learn a lot when you try using either of those distributions as you have to do everything from scratch starting from a minimal system. Since you’re saying you’re new to Linux though, I’d say you should start with something more user-friendly like Mint or Ubuntu (or even Manjaro if you want a rolling release distro) and stay away from Arch and Gentoo in the beginning.

mvirts , in Weird KDE Dolphin Disk Space Bug

Oh also who wants to play guess what’s in those directories ? It’s gotta be mostly music with that three level structure and size distribution

PhilBro , in How do you all go about backing up your data, on Linux?

I run Openmediavault and I backup using BorgBackup. Super easy to setup, use, and modify

ozymandias , in Rethinking Window Management on GNOME – Space and Meaning

That would be really awesome! Especially if it could learn your preferences automatically by how you change the default arrangement.

SethranKada , in How do you all go about backing up your data, on Linux?
@SethranKada@lemmy.ca avatar

I use Pika backup, which uses borg backup under the hood. It’s pretty good, with amazing documentation. Main issue I have with it is its really finicky and is kind of a pain to setup, even if it “just works” after that.

nikodunk ,

Can you restore from it? That’s the part I’ve always struggled with?

SethranKada ,
@SethranKada@lemmy.ca avatar

The way pika backup handles it, it loads the backup as a folder you can browse. I’ve used it a few times when hopping distros to copy and paste stuff from my home folder. Not very elegant, but it works and is very intuitive, even if I wish I could just hit a button and reset everything to the snapshot.

BaldProphet , in Is there a way to get the old ubuntu boot screen in 23.04?
@BaldProphet@kbin.social avatar

Oh man, you brought back memories. Memories of when Ubuntu was awesome.

happyhippo , in How do you all go about backing up your data, on Linux?

Vorta + borgbase

The yearly subscription is cheap and fits my storage needs by quite some margin. Gives me peace of mind to have an off-site back up.

I also store my documents on Google Drive.

style99 , in Apt, packages kept back: why and how to resolve it?
@style99@kbin.social avatar

nVidia drivers are a serious pain. You could brick your system if you aren't careful.

wildbus8979 ,

Brick is a big word. Nothing that can’t be fix by booting a rescue image and chrooting into your OS.

gabriele97 OP ,
@gabriele97@lemmy.g97.top avatar

You say that because they are listed as removable? If so because I updated from 515 to 525 months ago and today from 525 to 535. I think they are still there but are not used anymore and are safe

wmassingham ,

At most I think you’d have to blacklist the module from loading at boot time.

melroy ,
@melroy@kbin.melroy.org avatar

you can always run: rmmod nvidia and rmod nouveau. And then buy an AMD videocard. This works always! Thank me later!

moobythegoldensock , (edited ) in What is it with r/pcmasterrace and anti-Linuxism?

Why are you linking to reddit and not !pcmasterrace?

thelastknowngod , in Ubuntu on Nuc Network Access

I cannot connect via VNC or see the folders from other devices.

Troubleshooting literally anything with computers requires logs, error messages, description of current behavior (ideally with expected behavior), and a background of what other devices/systems/OSes/etc are involved.

Posts like this that basically say “it doesn’t work” with no additional context will NEVER get you any help because no one knows what problem you are seeing.

“I’m running X os, version Y. I’m trying to do Z. The error message i am seeing in the logs for $SERVICE is ‘FATAL: Unable to do $TASK’. I tried to do this but I’m still not seeing the expected behavior.”

^^ This is how you get someone to help you.

kaleissin , in Is there a way to get the old ubuntu boot screen in 23.04?

Which ubuntu had this boot screen?

kool_newt , in How do you all go about backing up your data, on Linux?

I made my own bash script that uses rsync. I stopped using Github so here’s a paste lol.

I define the backups like this, first item is source, other items on that line are it’s exclusions.

<pre style="background-color:#ffffff;">
<span style="color:#323232;">/home/shared
</span><span style="color:#323232;">/home/jamie     tmp/ dj_music/ Car_Music_USB
</span><span style="color:#323232;">/home/jamie_work
</span><span style="color:#323232;">
</span>
<pre style="background-color:#ffffff;">
<span style="color:#323232;">#!/usr/bin/ssh-agent /bin/bash
</span><span style="color:#323232;">
</span><span style="color:#323232;"># chronicle.sh
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Get absolute directory chronicle.sh is in
</span><span style="color:#323232;">REAL_PATH=`(cd $(dirname "$0"); pwd)`
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Defaults
</span><span style="color:#323232;">BACKUP_DEF_FILE="${REAL_PATH}/backup.conf"
</span><span style="color:#323232;">CONF_FILE="${REAL_PATH}/chronicle.conf"
</span><span style="color:#323232;">FAIL_IF_PRE_FAILS='0'
</span><span style="color:#323232;">FIXPERMS='true'
</span><span style="color:#323232;">FORCE='false'
</span><span style="color:#323232;">LOG_DIR='/var/log/chronicle'
</span><span style="color:#323232;">LOG_PREFIX='chronicle'
</span><span style="color:#323232;">NAME='backup'
</span><span style="color:#323232;">PID_FILE='~/chronicle/chronicle.pid'
</span><span style="color:#323232;">RSYNC_OPTS="-qRrltH --perms --delete --delete-excluded"
</span><span style="color:#323232;">SSH_KEYFILE="${HOME}/.ssh/id_rsa"
</span><span style="color:#323232;">TIMESTAMP='date +%Y%m%d-%T'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Set PID file for root user
</span><span style="color:#323232;">[ $EUID = 0 ] && PID_FILE='/var/run/chronicle.pid'
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Print an error message and exit
</span><span style="color:#323232;">ERROUT () {
</span><span style="color:#323232;">    TS="$(TS)"
</span><span style="color:#323232;">    echo "$TS $LOG_PREFIX (error): $1"
</span><span style="color:#323232;">    echo "$TS $LOG_PREFIX (error): Backup failed"
</span><span style="color:#323232;">    rm -f "$PID_FILE"
</span><span style="color:#323232;">    exit 1
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Usage output
</span><span style="color:#323232;">USAGE () {
</span><span style="color:#323232;">cat << EOF
</span><span style="color:#323232;">USAGE chronicle.sh [ OPTIONS ]
</span><span style="color:#323232;">
</span><span style="color:#323232;">OPTIONS
</span><span style="color:#323232;">    -f path   configuration file (default: chronicle.conf)
</span><span style="color:#323232;">    -F        force overwrite incomplete backup
</span><span style="color:#323232;">    -h        display this help
</span><span style="color:#323232;">EOF
</span><span style="color:#323232;">exit 0
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Timestamp
</span><span style="color:#323232;">TS ()
</span><span style="color:#323232;">{
</span><span style="color:#323232;">    if
</span><span style="color:#323232;">        echo $TIMESTAMP | grep tai64n &>/dev/null
</span><span style="color:#323232;">    then
</span><span style="color:#323232;">        echo "" | eval $TIMESTAMP
</span><span style="color:#323232;">    else
</span><span style="color:#323232;">        eval $TIMESTAMP
</span><span style="color:#323232;">    fi
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Logger function
</span><span style="color:#323232;"># First positional parameter is message severity (notice|warn|error)
</span><span style="color:#323232;"># The log message can be the second positional parameter, stdin, or a HERE string
</span><span style="color:#323232;">LOG () {
</span><span style="color:#323232;">    local TS="$(TS)"
</span><span style="color:#323232;">    # local input=""
</span><span style="color:#323232;">
</span><span style="color:#323232;">    msg_type="$1"
</span><span style="color:#323232;">
</span><span style="color:#323232;">    # if [[ -p /dev/stdin ]]; then
</span><span style="color:#323232;">    #     msg="$(cat -)"
</span><span style="color:#323232;">    # else
</span><span style="color:#323232;">        shift
</span><span style="color:#323232;">        msg="${@}"
</span><span style="color:#323232;">    # fi
</span><span style="color:#323232;">    echo "$TS chronicle ("$msg_type"): $msg"
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Logger function
</span><span style="color:#323232;"># First positional parameter is message severity (notice|warn|error)
</span><span style="color:#323232;"># The log message canbe stdin or a HERE string
</span><span style="color:#323232;">LOGPIPE () {
</span><span style="color:#323232;">    local TS="$(TS)"
</span><span style="color:#323232;">    msg_type="$1"
</span><span style="color:#323232;">    msg="$(cat -)"
</span><span style="color:#323232;">    echo "$TS chronicle ("$msg_type"): $msg"
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Process Options
</span><span style="color:#323232;">while
</span><span style="color:#323232;">    getopts ":d:f:Fmh" options; do
</span><span style="color:#323232;">        case $options in
</span><span style="color:#323232;">            d ) BACKUP_DEF_FILE="$OPTARG" ;;
</span><span style="color:#323232;">            f ) CONF_FILE="$OPTARG" ;;
</span><span style="color:#323232;">            F ) FORCE='true' ;;
</span><span style="color:#323232;">            m ) FIXPERMS='false' ;;
</span><span style="color:#323232;">            h ) USAGE; exit 0 ;;
</span><span style="color:#323232;">            * ) USAGE; exit 1 ;;
</span><span style="color:#323232;">    esac
</span><span style="color:#323232;">done
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Ensure a configuration file is found
</span><span style="color:#323232;">if
</span><span style="color:#323232;">    [ "x${CONF_FILE}" = 'x' ]
</span><span style="color:#323232;">then
</span><span style="color:#323232;">    ERROUT "Cannot find configuration file $CONF_FILE"
</span><span style="color:#323232;">fi
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Read the config file
</span><span style="color:#323232;">. "$CONF_FILE"
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Set the owner and mode for backup files
</span><span style="color:#323232;">if [ $FIXPERMS = 'true' ]; then
</span><span style="color:#323232;">#FIXVAR="--chown=${SSH_USER}:${SSH_USER} --chmod=D770,F660"
</span><span style="color:#323232;">FIXVAR="--usermap=*:${SSH_USER} --groupmap=*:${SSH_USER} --chmod=D770,F660"
</span><span style="color:#323232;">fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Set up logging
</span><span style="color:#323232;">
</span><span style="color:#323232;">if [ "${LOG_DIR}x" = 'x' ]; then
</span><span style="color:#323232;">    ERROUT "(error): ${LOG_DIR} not specified"
</span><span style="color:#323232;">fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">mkdir -p "$LOG_DIR"
</span><span style="color:#323232;">LOGFILE="${LOG_DIR}/chronicle.log"
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Make all output go to the log file
</span><span style="color:#323232;">exec >> $LOGFILE 2>&1
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Ensure a backup definitions file is found
</span><span style="color:#323232;">if
</span><span style="color:#323232;">    [ "x${BACKUP_DEF_FILE}" = 'x' ]
</span><span style="color:#323232;">then
</span><span style="color:#323232;">    ERROUT "Cannot find backup definitions file $BACKUP_DEF_FILE"
</span><span style="color:#323232;">fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Check for essential variables
</span><span style="color:#323232;">VARS='BACKUP_SERVER SSH_USER BACKUP_DIR BACKUP_QTY NAME TIMESTAMP'
</span><span style="color:#323232;">for var in $VARS; do
</span><span style="color:#323232;">    if [ ${var}x = x ]; then
</span><span style="color:#323232;">        ERROUT "${var} not specified"
</span><span style="color:#323232;">    fi
</span><span style="color:#323232;">done
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;">LOG notice "Backup started, keeping $BACKUP_QTY snapshots with name "$NAME""
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Export variables for use with external scripts
</span><span style="color:#323232;">export SSH_USER RSYNC_USER BACKUP_SERVER BACKUP_DIR LOG_DIR NAME REAL_PATH
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Check for PID
</span><span style="color:#323232;">if
</span><span style="color:#323232;">    [ -e "$PID_FILE" ]
</span><span style="color:#323232;">then
</span><span style="color:#323232;">    LOG error "$PID_FILE exists"
</span><span style="color:#323232;">    LOG error 'Backup failed'
</span><span style="color:#323232;">    exit 1
</span><span style="color:#323232;">fi
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Write PID
</span><span style="color:#323232;">touch "$PID_FILE"
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Add key to SSH agent
</span><span style="color:#323232;">ssh-add "$SSH_KEYFILE" 2>&1 | LOGPIPE notice -
</span><span style="color:#323232;">
</span><span style="color:#323232;"># enhance script readability
</span><span style="color:#323232;">CONN="${SSH_USER}@${BACKUP_SERVER}"
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Make sure the SSH server is available
</span><span style="color:#323232;">if
</span><span style="color:#323232;">    ! ssh $CONN echo -n ''
</span><span style="color:#323232;">then
</span><span style="color:#323232;">    ERROUT "$BACKUP_SERVER is unreachable"
</span><span style="color:#323232;">fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Fail if ${NAME}.0.tmp is found on the backup server.
</span><span style="color:#323232;">if
</span><span style="color:#323232;">    ssh ${CONN} [ -e "${BACKUP_DIR}/${NAME}.0.tmp" ] && [ "$FORCE" = 'false' ]
</span><span style="color:#323232;">then
</span><span style="color:#323232;">    ERROUT "${NAME}.0.tmp exists, ensure backup data is in order on the server"
</span><span style="color:#323232;">fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Try to create the destination directory if it does not already exist
</span><span style="color:#323232;">if
</span><span style="color:#323232;">    ssh $CONN [ ! -d $BACKUP_DIR ]
</span><span style="color:#323232;">then
</span><span style="color:#323232;">    if
</span><span style="color:#323232;">        ssh $CONN mkdir -p "$BACKUP_DIR"
</span><span style="color:#323232;">        ssh $CONN chown ${SSH_USER}:${SSH_USER} "$BACKUP_DIR"
</span><span style="color:#323232;">    then :
</span><span style="color:#323232;">    else
</span><span style="color:#323232;">        ERROUT "Cannot create $BACKUP_DIR"
</span><span style="color:#323232;">    fi
</span><span style="color:#323232;">fi
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Create metadata directory
</span><span style="color:#323232;">ssh $CONN mkdir -p "$BACKUP_DIR/chronicle_metadata"
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;">#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
</span><span style="color:#323232;"># PRE_COMMAND
</span><span style="color:#323232;">
</span><span style="color:#323232;">if
</span><span style="color:#323232;">    [ -n "$PRE_COMMAND" ]
</span><span style="color:#323232;">then
</span><span style="color:#323232;">    LOG notice "Running ${PRE_COMMAND}"
</span><span style="color:#323232;">    if
</span><span style="color:#323232;">        $PRE_COMMAND
</span><span style="color:#323232;">    then
</span><span style="color:#323232;">        LOG notice "${PRE_COMMAND} complete"
</span><span style="color:#323232;">    else
</span><span style="color:#323232;">        LOG error "Execution of ${PRE_COMMAND} was not successful"
</span><span style="color:#323232;">        if [ "$FAIL_IF_PRE_FAILS" -eq 1 ]; then
</span><span style="color:#323232;">            ERROUT 'Command specified by PRE_COMMAND failed and FAIL_IF_PRE_FAILS enabled'
</span><span style="color:#323232;">        fi
</span><span style="color:#323232;">    fi
</span><span style="color:#323232;">fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;">#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
</span><span style="color:#323232;"># Backup
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Make a hard link copy of backup.0 to rsync with
</span><span style="color:#323232;">if [ $FORCE = 'false' ]; then
</span><span style="color:#323232;">    ssh $CONN "[ -d ${BACKUP_DIR}/${NAME}.0 ] && cp -al ${BACKUP_DIR}/${NAME}.0 ${BACKUP_DIR}/${NAME}.0.tmp"
</span><span style="color:#323232;">fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;">while read -u 9 l; do
</span><span style="color:#323232;">
</span><span style="color:#323232;">    # Skip commented lines
</span><span style="color:#323232;">    if [[ "$l" =~ ^#.* ]]; then
</span><span style="color:#323232;">    continue
</span><span style="color:#323232;">    fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">    if [[ $l = '/*'* ]]; then
</span><span style="color:#323232;">        LOG warn "$SOURCE is not an absolute path"
</span><span style="color:#323232;">        continue
</span><span style="color:#323232;">    fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">    # Reduce whitespace to one tab
</span><span style="color:#323232;">    line=$(echo $l | tr -s [:space:] 't')
</span><span style="color:#323232;">
</span><span style="color:#323232;">    # get the source
</span><span style="color:#323232;">    SOURCE=$(echo "$line" | cut -f1)
</span><span style="color:#323232;">
</span><span style="color:#323232;">    # get the exclusions
</span><span style="color:#323232;">    EXCLUSIONS=$(echo "$line" | cut -f2-)
</span><span style="color:#323232;">
</span><span style="color:#323232;">    # Format exclusions for the rsync command
</span><span style="color:#323232;">    unset exclude_line
</span><span style="color:#323232;">    if [ ! "$EXCLUSIONS" = '' ]; then
</span><span style="color:#323232;">        for each in $EXCLUSIONS; do
</span><span style="color:#323232;">            exclude_line="$exclude_line--exclude $each "
</span><span style="color:#323232;">        done
</span><span style="color:#323232;">    fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;">    LOG notice "Using SSH transport for $SOURCE"
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;">    # get directory metadata
</span><span style="color:#323232;">    PERMS="$(getfacl -pR "$SOURCE")"
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;">    # Copy metadata
</span><span style="color:#323232;">    ssh $CONN mkdir -p ${BACKUP_DIR}/chronicle_metadata/${SOURCE}
</span><span style="color:#323232;">    echo "$PERMS" | ssh $CONN -T "cat > ${BACKUP_DIR}/chronicle_metadata/${SOURCE}/metadata"
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;">    LOG debug "rsync $RSYNC_OPTS $exclude_line "$FIXVAR" "$SOURCE" 
</span><span style="color:#323232;">    "${SSH_USER}"@"$BACKUP_SERVER":"${BACKUP_DIR}/${NAME}.0.tmp""
</span><span style="color:#323232;">
</span><span style="color:#323232;">    rsync $RSYNC_OPTS $exclude_line $FIXVAR "$SOURCE" 
</span><span style="color:#323232;">    "${SSH_USER}"@"$BACKUP_SERVER":"${BACKUP_DIR}/${NAME}.0.tmp"
</span><span style="color:#323232;">
</span><span style="color:#323232;">done 9< "${BACKUP_DEF_FILE}"
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;">#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
</span><span style="color:#323232;"># Try to see if the backup succeeded
</span><span style="color:#323232;">
</span><span style="color:#323232;">if
</span><span style="color:#323232;">    ssh $CONN [ ! -d "${BACKUP_DIR}/${NAME}.0.tmp" ]
</span><span style="color:#323232;">then
</span><span style="color:#323232;">    ERROUT "${BACKUP_DIR}/${NAME}.0.tmp not found, no new backup created"
</span><span style="color:#323232;">fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Test for empty temp directory
</span><span style="color:#323232;">if
</span><span style="color:#323232;">    ssh $CONN [ ! -z "$(ls -A ${BACKUP_DIR}/${NAME}.0.tmp 2>/dev/null)" ]
</span><span style="color:#323232;">then
</span><span style="color:#323232;">    ERROUT "No new backup created"
</span><span style="color:#323232;">fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
</span><span style="color:#323232;"># Rotate
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Number of oldest backup
</span><span style="color:#323232;">X=`expr $BACKUP_QTY - 1`
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;">LOG notice 'Rotating previous backups'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># keep oldest directory temporarily in case rotation fails
</span><span style="color:#323232;">ssh $CONN [ -d "${BACKUP_DIR}/${NAME}.${X}" ] && 
</span><span style="color:#323232;">ssh $CONN mv "${BACKUP_DIR}/${NAME}.${X}" "${BACKUP_DIR}/${NAME}.${X}.tmp"
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Rotate previous backups
</span><span style="color:#323232;">until [ $X -eq -1 ]; do
</span><span style="color:#323232;">    Y=$X
</span><span style="color:#323232;">    X=`expr $X - 1`
</span><span style="color:#323232;">
</span><span style="color:#323232;">    ssh $CONN [ -d "${BACKUP_DIR}/${NAME}.${X}" ] && 
</span><span style="color:#323232;">    ssh $CONN mv "${BACKUP_DIR}/${NAME}.${X}" "${BACKUP_DIR}/${NAME}.${Y}"
</span><span style="color:#323232;">    [ $X -eq 0 ] && break
</span><span style="color:#323232;">done
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Create "backup.0" directory
</span><span style="color:#323232;">ssh $CONN mkdir -p "${BACKUP_DIR}/${NAME}.0"
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Get individual items in "backup.0.tmp" directory into "backup.0"
</span><span style="color:#323232;"># so that items removed from backup definitions rotate out
</span><span style="color:#323232;">while read -u 9 l; do
</span><span style="color:#323232;">
</span><span style="color:#323232;">    # Skip commented lines
</span><span style="color:#323232;">    if [[ "$l" =~ ^#.* ]]; then
</span><span style="color:#323232;">    continue
</span><span style="color:#323232;">    fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">    # Skip invalid sources that are not an absolute path"
</span><span style="color:#323232;">    if [[ $l = '/*'* ]]; then
</span><span style="color:#323232;">        continue
</span><span style="color:#323232;">    fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">    # Reduce multiple tabs to one
</span><span style="color:#323232;">    line=$(echo $l | tr -s [:space:] 't')
</span><span style="color:#323232;">
</span><span style="color:#323232;">    source=$(echo "$line" | cut -f1)
</span><span style="color:#323232;">
</span><span style="color:#323232;">    source_basedir="$(dirname $source)"
</span><span style="color:#323232;">
</span><span style="color:#323232;">    ssh $CONN mkdir -p "${BACKUP_DIR}/${NAME}.0/${source_basedir}"
</span><span style="color:#323232;">
</span><span style="color:#323232;">    LOG debug "ssh $CONN cp -al "${BACKUP_DIR}/${NAME}.0.tmp${source}" "${BACKUP_DIR}/${NAME}.0${source_basedir}""
</span><span style="color:#323232;">
</span><span style="color:#323232;">    ssh $CONN cp -al "${BACKUP_DIR}/${NAME}.0.tmp${source}" "${BACKUP_DIR}/${NAME}.0${source_basedir}"
</span><span style="color:#323232;">
</span><span style="color:#323232;">done 9< "${BACKUP_DEF_FILE}"
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Remove oldest backup
</span><span style="color:#323232;">X=`expr $BACKUP_QTY - 1` # Number of oldest backup
</span><span style="color:#323232;">ssh $CONN rm -Rf "${BACKUP_DIR}/${NAME}.${X}.tmp"
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Set time stamp on backup directory
</span><span style="color:#323232;">ssh $CONN touch -m "${BACKUP_DIR}/${NAME}.0"
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Delete temp copy of backup
</span><span style="color:#323232;">ssh $CONN rm -Rf "${BACKUP_DIR}/${NAME}.0.tmp"
</span><span style="color:#323232;">
</span><span style="color:#323232;">#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
</span><span style="color:#323232;"># Post Command
</span><span style="color:#323232;">
</span><span style="color:#323232;">if
</span><span style="color:#323232;">    [ ! "${POST_COMMAND}x" = 'x' ]
</span><span style="color:#323232;">then
</span><span style="color:#323232;">    LOG notice "Running ${POST_COMMAND}"
</span><span style="color:#323232;">    if
</span><span style="color:#323232;">        $POST_COMMAND
</span><span style="color:#323232;">    then
</span><span style="color:#323232;">        LOG notice "${POST_COMMAND} complete"
</span><span style="color:#323232;">    else
</span><span style="color:#323232;">        LOG warning "${POST_COMMAND} complete with errors"
</span><span style="color:#323232;">    fi
</span><span style="color:#323232;">fi
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Delete PID file
</span><span style="color:#323232;">rm -f "$PID_FILE"
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Log success message
</span><span style="color:#323232;">LOG notice 'Backup completed successfully'
</span><span style="color:#323232;">
</span>
Anticorp , in What distribution is most used in production environment

At this point? Probably Cent OS, since that’s what AWS uses. It’s a variation of Ubuntu. So if you don’t count it as separate, then definitely Ubuntu.

karlthemailman ,

Are you sure you mean centos? Centos is a rolling release of the next version of rhel.

vanderbilt ,
@vanderbilt@beehaw.org avatar

Amazon Linux 2 uses a mix of stream and Fedora IIRC.

SeeJayEmm ,
@SeeJayEmm@lemmy.procrastinati.org avatar

CentOS is an RHEL variant, not Ubuntu.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines