Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #202104 > unrolled thread

Archiving content of a directory on a DVD-R.

Started bypeter@easthope.ca
First post2018-11-04 16:50 +0100
Last post2018-11-14 16:40 +0100
Articles 9 on this page of 29 — 7 participants

Back to article view | Back to linux.debian.user


Contents

  Archiving content of a directory on a DVD-R. peter@easthope.ca - 2018-11-04 16:50 +0100
    Re: Archiving content of a directory on a DVD-R. "Thomas Schmitt" <scdbackup@gmx.net> - 2018-11-04 19:00 +0100
      Re: Archiving content of a directory on a DVD-R. Jonathan Dowland <jmtd@debian.org> - 2018-11-07 12:30 +0100
        Re: Archiving content of a directory on a DVD-R. "Thomas Schmitt" <scdbackup@gmx.net> - 2018-11-07 13:10 +0100
          Re: Archiving content of a directory on a DVD-R. Jonathan Dowland <jmtd@debian.org> - 2018-11-07 15:40 +0100
    Re: Archiving content of a directory on a DVD-R. David Christensen <dpchrist@holgerdanske.com> - 2018-11-05 00:20 +0100
    Re: Archiving content of a directory on a DVD-R. Greg Wooledge <wooledg@eeg.ccf.org> - 2018-11-05 15:10 +0100
      Re: Archiving content of a directory on a DVD-R. <tomas@tuxteam.de> - 2018-11-05 15:40 +0100
    Re : Archiving content of a directory on a DVD-R. peter@easthope.ca - 2018-11-07 23:40 +0100
      Re: Archiving content of a directory on a DVD-R. "Thomas Schmitt" <scdbackup@gmx.net> - 2018-11-08 09:00 +0100
    Re: Archiving content of a directory on a DVD-R. peter@easthope.ca - 2018-11-08 00:00 +0100
      pushd/podp (was Re: Archiving content of a directory on a DVD-R.) Jonathan Dowland <jmtd@debian.org> - 2018-11-08 10:50 +0100
        Re: pushd/popd peter@easthope.ca - 2018-11-09 16:10 +0100
          Re: pushd/popd Greg Wooledge <wooledg@eeg.ccf.org> - 2018-11-09 17:30 +0100
            Re: pushd/popd Jonathan Dowland <jmtd@debian.org> - 2018-11-09 21:50 +0100
          Re: pushd/popd Jonathan Dowland <jmtd@debian.org> - 2018-11-09 17:30 +0100
          Re: pushd/popd peter@easthope.ca - 2018-11-10 19:30 +0100
            Re: pushd/popd David Wright <deblis@lionunicorn.co.uk> - 2018-11-11 07:00 +0100
              Re: pushd/popd Greg Wooledge <wooledg@eeg.ccf.org> - 2018-11-12 14:50 +0100
                Re: pushd/popd David Wright <deblis@lionunicorn.co.uk> - 2018-11-12 21:40 +0100
      Re: Archiving content of a directory on a DVD-R. Greg Wooledge <wooledg@eeg.ccf.org> - 2018-11-08 14:20 +0100
        Re: Archiving content of a directory on a DVD-R. peter@easthope.ca - 2018-11-12 23:00 +0100
          Re: Archiving content of a directory on a DVD-R. Greg Wooledge <wooledg@eeg.ccf.org> - 2018-11-12 23:20 +0100
            Re: Archiving content of a directory on a DVD-R. peter@easthope.ca - 2018-11-13 03:40 +0100
              Re: Archiving content of a directory on a DVD-R. Greg Wooledge <wooledg@eeg.ccf.org> - 2018-11-13 14:20 +0100
                Re: Archiving content of a directory on a DVD-R. peter@easthope.ca - 2018-11-13 16:00 +0100
                Re: Archiving content of a directory on a DVD-R. Jonathan Dowland <jmtd@debian.org> - 2018-11-14 11:00 +0100
                  Re: Archiving content of a directory on a DVD-R. Greg Wooledge <wooledg@eeg.ccf.org> - 2018-11-14 14:40 +0100
                    Re: Archiving content of a directory on a DVD-R. Jonathan Dowland <jmtd@debian.org> - 2018-11-14 16:40 +0100

Page 2 of 2 — ← Prev page 1 [2]


#202254

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2018-11-08 14:20 +0100
Message-ID<wRSo1-3Tv-1@gated-at.bofh.it>
In reply to#202241
On Wed, Nov 07, 2018 at 01:52:13PM -0800, peter@easthope.ca wrote:
> My backup procedures are shell functions 
> rather than scripts

That's pretty bizarre.  I don't see what advantage that gives you over
simply putting the commands in a script so that you can run something like
"sudo backup" on demand.

Since your backup seems to be tied to your interactive environment, that
also makes it difficult or impossible to schedule backups in cron.

[toc] | [prev] | [next] | [standalone]


#202345

Frompeter@easthope.ca
Date2018-11-12 23:00 +0100
Message-ID<wTspr-77E-7@gated-at.bofh.it>
In reply to#202254
On Wed, Nov 07, 2018 at 01:52:13PM -0800, peter@easthope.ca wrote:
> > My backup procedures are shell functions 
> > rather than scripts

*	From: Greg Wooledge <wooledg@eeg.ccf.org>
*	Date: Thu, 8 Nov 2018 08:18:15 -0500
> That's pretty bizarre.  I don't see what advantage that gives you over
> simply putting the commands in a script so that you can run something like
> "sudo backup" on demand.

How are multiple commands defined in one file?  Then invoke?
sudo backup1
sudo backup2
sudo backup3

Thanks,                  ... Peter E.



-- 
Message composed and transmitted by software designed to avoid the 
need, overhead and vulnerability of antivirus software.

123456789 123456789 123456789 123456789 123456789 123456789 123456789
Tel: +1 360 639 0202                                  +1 
http://easthope.ca/Peter.html              Bcc: peter at easthope. ca

[toc] | [prev] | [next] | [standalone]


#202347

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2018-11-12 23:20 +0100
Message-ID<wTsIN-7uN-7@gated-at.bofh.it>
In reply to#202345
On Mon, Nov 12, 2018 at 01:13:14PM -0800, peter@easthope.ca wrote:
> How are multiple commands defined in one file?  Then invoke?
> sudo backup1
> sudo backup2
> sudo backup3

Just put all the commands in one script, for example:

#!/bin/sh
backup1 &&
backup2 &&
backup3


Then run "sudo /the/backupscript".  If it's in a directory in your PATH,
you can simply do "sudo backupscript".

Of course, your example is so entirely obfuscated and genericized that
it's meaningless.  You can't even demonstrate anything with it.

Here's the backup script I use at home, with only one piece of information
hidden.  It's not elegant.  It's simply what I've got.

It is named /usr/local/bin/backup.  When I want to run it, I type
"sudo backup".

#!/bin/bash

cd /backup || exit
today=$(date +%Y%m%d)

if [ -e /hd/.hd ]; then
    ( cd / && rsync -av --delete etc home usr/local /hd/titan/ )
    ( cd /stuff && rsync -av --delete * /hd/ )
else
    echo "/hd not mounted"
fi

( cd /etc && find . -print0 |
    cpio -o -0 | gzip > "/backup/compress/backup.$HOSTNAME.etc.$today" )

( export RSYNC_RSH='ssh -p [REDACTED]';
  cd remote && rsync -av --delete root@remote.wooledge.org:{/etc,/var/moin} . )

( cd remote && find . -print0 |
    cpio -o -0 | gzip > "/backup/compress/backup.remote.$today" )

( cd /home && find . \( -type d -name .cache \) -prune -o -print0 |
    cpio -o -0 | gzip > "/backup/compress/backup.$HOSTNAME.home.$today" )

find compress -type f -mtime +4 -delete
( cd compress && mkisofs -o ../image . )

ls -ld image
read -p "Write to DVD? [y] " yn
case $yn in ''|[Yy]|[Yy]es) : ;; *) exit ;; esac
cdrecord -v image

[toc] | [prev] | [next] | [standalone]


#202348

Frompeter@easthope.ca
Date2018-11-13 03:40 +0100
Message-ID<wTwMp-1yX-1@gated-at.bofh.it>
In reply to#202347
*	From: Greg Wooledge <wooledg@eeg.ccf.org>
*	Date: Mon, 12 Nov 2018 17:14:13 -0500
> Just put all the commands in one script, for example:
> 
> #!/bin/sh
> backup1 &&
> backup2 &&
> backup3

I was afraid you meant that.  =8~)  My three scripts are executed 
interactively. To my knowledge there can be only one script in a file.  
=8~|  By defining chell functions, all three are in .bashrc.  =8~)

> Here's the backup script I use at home, ...

OK, my first stage follows.  ~/MY/ is an SD card.  This Backup is 
executed when I finish editing something or finish enough editing that 
I wouldn't want to retype it after the flash store fails.  It merely 
syncs from ~/MY/ into ~/MY0.Bak or, if executed with any parameter, to 
~/MY1.Bak.  Then it reports the size of MailMessages and the current size 
of the backup.  Subdirectories, logs, voice messages, installer archives 
and similar non-essential data are excluded.  Definitely more 
primitive than your backup.  Comments welcome of course.

The further two functions put the backup on a DVD-R.  Done once per 
week or less depending on competing "essential" work, fatigue & etc.  Can 
discuss these stages 2 and 3 later.

Thanks,                         ... Peter E.

================================
Backup() { \
 if [ $# -gt 1 ]; then
   echo "Too many arguments.";
 else
   echo "0 or 1 arguments are OK.";
   if [ $# -eq 0 ]; then
     echo "0 arguments is OK.";
     destination=~/MY0.Bak;
     echo "destination is $destination.";
   else
     echo "1 argument is OK.";
     destination=~/MY1.Bak;
     echo "destination is $destination.";
   fi;
     echo "Executing rsync.";
     rsync \
      --exclude "*/" \
      --exclude='AOS*' \
      --exclude='Trap*' \
      --exclude='*.WAV' \
      --exclude='.aoshome' \
      --exclude "lost+found" \
      --exclude='*.Bak' \
      --exclude='*.bundle' \
      --exclude='*.iso' \
      --exclude='*.mp3' \
      --exclude='*.mp4' \
      --exclude='pe' \
      --exclude='*.sig' \
      --exclude='*.webm' \
      --exclude='*.zd' \
      --exclude='*.zip' \
      --exclude='*Libre*' \
      --exclude='*Linux*' \
      --exclude='Configuration.XML' \
      --exclude='Oberon*Fnt' \
      --exclude='Oberon.Text' \
      -auv /home/peter/MY/* $destination ;
     /bin/ls -ld ~/MY/MailMessages;
     printf "du -s $destination gives ";
     du -s $destination;
  fi;
}

-- 
Message composed and transmitted by software designed to avoid the 
need, overhead and vulnerability of antivirus software.

123456789 123456789 123456789 123456789 123456789 123456789 123456789
Tel: +1 360 639 0202                                  +1 
http://easthope.ca/Peter.html              Bcc: peter at easthope. ca

[toc] | [prev] | [next] | [standalone]


#202358

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2018-11-13 14:20 +0100
Message-ID<wTGLM-8eH-11@gated-at.bofh.it>
In reply to#202348
On Mon, Nov 12, 2018 at 06:15:29PM -0800, peter@easthope.ca wrote:
> I was afraid you meant that.  =8~)  My three scripts are executed 
> interactively. To my knowledge there can be only one script in a file.  
> =8~|  By defining chell functions, all three are in .bashrc.  =8~)

So move them to scripts instead.  Or a single script.

Defining your system backup in your end-user account's shell functions
just seems completely silly and pointless.

But clearly you're going to ignore all advice I give, so fine.  It's
your system.  Do whatever you want.

[toc] | [prev] | [next] | [standalone]


#202359

Frompeter@easthope.ca
Date2018-11-13 16:00 +0100
Message-ID<wTIky-DC-7@gated-at.bofh.it>
In reply to#202358
*	From: Greg Wooledge <wooledg@eeg.ccf.org>
*	Date: Tue, 13 Nov 2018 08:15:13 -0500
> So move them to scripts instead.  Or a single script.

Likely the 2nd (archive build) and 3rd (DVD burn) stages will be 
combined after they have worked for a few weeks with no obvious 
problems.  The first stage will remain distinct.  No need to burn 
multiple DVDs in day. Yes need to sync the SD card to the HDD 
frequently.

> Defining your system backup in your end-user account's shell functions 
> just seems completely silly and pointless.

System backup is provided by debian.  Eg.
https://cdimage.debian.org/debian-cd/current/i386/iso-cd/debian-9.6.0-i386-netinst.iso
No point in backing a widely available archive.  If the HDD fails, 
install another and proceed with *netinst.iso.

My own data is backed of course.  By Backup according to previous 
message.

Additional point: work at user status when possible; root status when 
necessary.  Arbitrary use of root status opens unnecessary 
vulnerability.

> But clearly you're going to ignore all advice I give, so fine.

Not ignoring advice.  Replies concerning pushd, popd, tar and xorriso 
have been invaluable.

Thanks,               ... Peter E.





-- 
Message composed and transmitted by software designed to avoid the 
complication, overhead and vulnerability of antivirus software.

123456789 123456789 123456789 123456789 123456789 123456789 123456789
Tel: +1 360 639 0202                                  +1 
http://easthope.ca/Peter.html              Bcc: peter at easthope. ca

[toc] | [prev] | [next] | [standalone]


#202389

FromJonathan Dowland <jmtd@debian.org>
Date2018-11-14 11:00 +0100
Message-ID<wU07M-3MM-5@gated-at.bofh.it>
In reply to#202358
On Tue, Nov 13, 2018 at 08:15:13AM -0500, Greg Wooledge wrote:
>So move them to scripts instead.  Or a single script.
>
>Defining your system backup in your end-user account's shell functions
>just seems completely silly and pointless.

I can't really see the problem, assuming ~/.bashrc is being backed up in
the same way you might expect ~/bin/backup{1,2,3} to be.

-- 

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Jonathan Dowland
⢿⡄⠘⠷⠚⠋⠀ https://jmtd.net
⠈⠳⣄⠀⠀⠀⠀ Please do not CC me, I am subscribed to the list.

[toc] | [prev] | [next] | [standalone]


#202403

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2018-11-14 14:40 +0100
Message-ID<wU3yF-65z-1@gated-at.bofh.it>
In reply to#202389
On Wed, Nov 14, 2018 at 09:55:31AM +0000, Jonathan Dowland wrote:
> On Tue, Nov 13, 2018 at 08:15:13AM -0500, Greg Wooledge wrote:
> > So move them to scripts instead.  Or a single script.
> > 
> > Defining your system backup in your end-user account's shell functions
> > just seems completely silly and pointless.
> 
> I can't really see the problem, assuming ~/.bashrc is being backed up in
> the same way you might expect ~/bin/backup{1,2,3} to be.

The point is you can run "sudo ascript" but you cannot run "sudo afunction".

[toc] | [prev] | [next] | [standalone]


#202415

FromJonathan Dowland <jmtd@debian.org>
Date2018-11-14 16:40 +0100
Message-ID<wU5qO-7ku-21@gated-at.bofh.it>
In reply to#202403
On Wed, Nov 14, 2018 at 08:37:41AM -0500, Greg Wooledge wrote:
>The point is you can run "sudo ascript" but you cannot run "sudo afunction".

Oh yes of course. I had forgotten that from the earlier messages. Sorry
for the noise.

-- 

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Jonathan Dowland
⢿⡄⠘⠷⠚⠋⠀ https://jmtd.net
⠈⠳⣄⠀⠀⠀⠀ Please do not CC me, I am subscribed to the list.

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | linux.debian.user


csiph-web