Discussion:
Backing up mail files
cr
2011-03-08 10:39:30 UTC
Permalink
Quick question for the gurus.

I use Kmail, my emails (Maildir format) live on a separate drive from the OS,
but it occurs to me I should back them up regularly. Easiest way would be
to run a script at startup,
cp -Ruv /cr11/Mail\(kmail\) /cr33/Mailbackup
seems to work OK as a command so presumably it would work as a script.
(The -u should mean only new maildir files get copied, I would probably leave
the -v off)
Any suggestion where I should put it to run at startup? (Oh, currently
running Debian 5.0 still, till I have time to try 6.0)

And, are there any hideous snags I haven't thought of that will crash my
system, destroy the ozone layer, or generate a planet-sized black hole where
my computer once was? I haven't done a script before, you see.

cr



_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Nevyn
2011-03-08 10:43:42 UTC
Permalink
Post by cr
Quick question for the gurus.
I use Kmail, my emails (Maildir format) live on a separate drive from the OS,
but it occurs to me I should back them up regularly.   Easiest way would be
to run a script at startup,
cp -Ruv /cr11/Mail\(kmail\)   /cr33/Mailbackup
seems to work OK as a command so presumably it would work as a script.
(The -u should mean only new maildir files get copied, I would probably leave
the -v off)
Any suggestion where I should put it to run at startup?   (Oh, currently
running Debian 5.0 still, till I have time to try 6.0)
And, are there any hideous snags I haven't thought of that will crash my
system, destroy the ozone layer, or generate a planet-sized black hole where
my computer once was?    I haven't done a script before, you see.
cr
Using kmail - are you running it in kde or gnome? I ask while I try to
think of the location I had to put a .desktop file for gnome to run a
script on login (rather than startup). The only snag I can think of is
that your path possibly isn't set at the time though I don't believe
this could possibly effect cp which I think is built into bash though
I could be wrong.

Regards,
Nevyn
http://nevsramblings.blogspot.com/

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
cr
2011-03-08 11:03:33 UTC
Permalink
Post by Nevyn
Post by cr
Quick question for the gurus.
I use Kmail, my emails (Maildir format) live on a separate drive from the
OS, but it occurs to me I should back them up regularly.   Easiest way
would be to run a script at startup,
cp -Ruv /cr11/Mail\(kmail\)   /cr33/Mailbackup
seems to work OK as a command so presumably it would work as a script.
(The -u should mean only new maildir files get copied, I would probably
leave the -v off)
Any suggestion where I should put it to run at startup?   (Oh, currently
running Debian 5.0 still, till I have time to try 6.0)
And, are there any hideous snags I haven't thought of that will crash my
system, destroy the ozone layer, or generate a planet-sized black hole
where my computer once was?    I haven't done a script before, you see.
cr
Using kmail - are you running it in kde or gnome? I ask while I try to
think of the location I had to put a .desktop file for gnome to run a
script on login (rather than startup). The only snag I can think of is
that your path possibly isn't set at the time though I don't believe
this could possibly effect cp which I think is built into bash though
I could be wrong.
Regards,
Nevyn
http://nevsramblings.blogspot.com/
Oh, running it under Gnome.

Since I'm the only user, startup and login happen one after the other,
typically. And (due to habit) I have gdm disabled so I login on the
command line and type 'startx' to get the desktop.

So probably login is a slightly better time than startup to run the script.
Thanks, I hadn't thought of that.

cr


_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Mark Robinson
2011-03-08 11:01:42 UTC
Permalink
Post by cr
Quick question for the gurus.
I use Kmail, my emails (Maildir format) live on a separate drive from the OS,
but it occurs to me I should back them up regularly. Easiest way would be
to run a script at startup,
cp -Ruv /cr11/Mail\(kmail\) /cr33/Mailbackup
seems to work OK as a command so presumably it would work as a script.
(The -u should mean only new maildir files get copied, I would probably leave
the -v off)
Any suggestion where I should put it to run at startup? (Oh, currently
running Debian 5.0 still, till I have time to try 6.0)
And, are there any hideous snags I haven't thought of that will crash my
system, destroy the ozone layer, or generate a planet-sized black hole where
my computer once was? I haven't done a script before, you see.
cr
There are many ways to do this.

One is using cron, type
crontab -e
and then add your command preceded by @reboot, ie
@reboot cp -Ruv /cr11/Mail\(kmail\) /cr33/Mailbackup

You may benefit from learning about rsync at your leisure.

Also, have a look at backintime: http://backintime.le-web.org/
aptiude show backintime-common

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Nevyn
2011-03-08 11:19:10 UTC
Permalink
Post by Mark Robinson
Post by cr
Quick question for the gurus.
I use Kmail, my emails (Maildir format) live on a separate drive from the OS,
but it occurs to me I should back them up regularly.   Easiest way would
be
to run a script at startup,
cp -Ruv /cr11/Mail\(kmail\)   /cr33/Mailbackup
seems to work OK as a command so presumably it would work as a script.
(The -u should mean only new maildir files get copied, I would probably leave
the -v off)
Any suggestion where I should put it to run at startup?   (Oh, currently
running Debian 5.0 still, till I have time to try 6.0)
And, are there any hideous snags I haven't thought of that will crash my
system, destroy the ozone layer, or generate a planet-sized black hole where
my computer once was?    I haven't done a script before, you see.
cr
There are many ways to do this.
One is using cron, type
 crontab -e
You may benefit from learning about rsync at your leisure.
Also, have a look at backintime: http://backintime.le-web.org/
 aptiude show backintime-common
In this scenario, /etc/rc.d would be equally as valid though I always
think in terms of multiple users (even though at home it's usually
only me) it might be cool. Or ~/.bashrc. Although - I do wonder...
Would it be better for this to happen at shut down after you've
downloaded your emails?

Regards,
Nevyn
http://nevsramblings.blogspot.com/

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
cr
2011-03-09 08:27:55 UTC
Permalink
(snip)
Post by Nevyn
Post by Mark Robinson
There are many ways to do this.
One is using cron, type
 crontab -e
You may benefit from learning about rsync at your leisure.
Also, have a look at backintime: http://backintime.le-web.org/
 aptiude show backintime-common
In this scenario, /etc/rc.d would be equally as valid though I always
think in terms of multiple users (even though at home it's usually
only me) it might be cool. Or ~/.bashrc. Although - I do wonder...
Would it be better for this to happen at shut down after you've
downloaded your emails?
Regards,
Nevyn
http://nevsramblings.blogspot.com/
Yes, you're quite correct, in terms of email security it would be better at
shutdown. However, I frequently shut down in something of a hurry
(encouraged by wifely shouts of 'Hurry up!' from the direction of the
carport) so for me it's better on startup. And I always switch off at the
wall after the computer has shut down, killing the power to the 23 assorted
digital/audio/visual gadgets that hang off the wall plug, so leaving it to
shut itself down is not feasible. I can afford to risk losing one day's
emails. Other people will have different priorities.

Regards

Chris

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug

Continue reading on narkive:
Loading...