FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux General Discussion

 
 
LinkBack Thread Tools
 
Old 06-20-2012, 08:36 AM
Arno Gaboury
 
Default back up /var/log before shutdown

Dear all,

My /, /boot and /usr are on a BTRFS /(except /boot on ext2) on a ssd.
I want to add this line in my fstab to avoid too many writings on my ssd :

*tmpfs /var/log tmpfs nodev,nosuid,noexec 0 0*

So each time I reboot, my /var/log will be emptied, which could be a
problem in case of serious issue on my box. I was then thinking of a way
to backup this folder before I shutdown. I found this trick in the Arch
forum:


add this in my */etc/rc.local.shutdown*:

|*echo "Copying LOGs..."

now=`date +"%Y%m%d_%Hh%M"`
mkdir -p /logs_backup/$now
cp -Rp /var/log/* ~/backup/logs_backup/$now/*

My ~ folder is on another HD.

Will this script be enough to do the job?

TY for advising.
|
 
Old 06-20-2012, 09:03 AM
Gaetan Bisson
 
Default back up /var/log before shutdown

[2012-06-20 10:36:17 +0200] Arno Gaboury:
> My /, /boot and /usr are on a BTRFS /(except /boot on ext2) on a ssd.
> I want to add this line in my fstab to avoid too many writings on my ssd :
>
> *tmpfs /var/log tmpfs nodev,nosuid,noexec 0 0*
>
> So each time I reboot, my /var/log will be emptied, which could be a
> problem in case of serious issue on my box. I was then thinking of a
> way to backup this folder before I shutdown. I found this trick in
> the Arch forum:
>
> add this in my */etc/rc.local.shutdown*:
>
> |*echo "Copying LOGs..."
>
> now=`date +"%Y%m%d_%Hh%M"`
> mkdir -p /logs_backup/$now
> cp -Rp /var/log/* ~/backup/logs_backup/$now/*
>
> My ~ folder is on another HD.
>
> Will this script be enough to do the job?

Why are you inflicting such a complicated setup on yourself if you
cannot understand what those three little lines of shell do? That seems
to me like a completely backward way of taking the learning curve...

Also, please create new threads instead of hijacking random ones.

Cheers.

--
Gaetan
 
Old 06-20-2012, 09:08 AM
gt
 
Default back up /var/log before shutdown

On Wed, Jun 20, 2012 at 10:36:17AM +0200, Arno Gaboury wrote:
> Dear all,
> [snip]
> TY for advising.

Hello Arno

Sorry for the offtopic bit, but i have noticed that your threads tend to
branch out from some other thread, many times.

I believe that you use the reply button on an existing topic and then
start your own thread. This looks very weird and is also confusing, as i
think your message is related to the one you forked, while it is not.

Please always start a new thread
 
Old 06-20-2012, 09:08 AM
Arno Gaboury
 
Default back up /var/log before shutdown

On 06/20/2012 11:03 AM, Gaetan Bisson wrote:

[2012-06-20 10:36:17 +0200] Arno Gaboury:

My /, /boot and /usr are on a BTRFS /(except /boot on ext2) on a ssd.
I want to add this line in my fstab to avoid too many writings on my ssd :

*tmpfs /var/log tmpfs nodev,nosuid,noexec 0 0*

So each time I reboot, my /var/log will be emptied, which could be a
problem in case of serious issue on my box. I was then thinking of a
way to backup this folder before I shutdown. I found this trick in
the Arch forum:

add this in my */etc/rc.local.shutdown*:

|*echo "Copying LOGs..."

now=`date +"%Y%m%d_%Hh%M"`
mkdir -p /logs_backup/$now
cp -Rp /var/log/* ~/backup/logs_backup/$now/*

My ~ folder is on another HD.

Will this script be enough to do the job?

Why are you inflicting such a complicated setup on yourself if you
cannot understand what those three little lines of shell do? That seems
to me like a completely backward way of taking the learning curve...

Also, please create new threads instead of hijacking random ones.

Cheers.

Ok for the new threads, please excuse my n00biness (and lazyness) about
this issue.
I fully understand these 3 lines, and thought it was not a complicated
way to back up /var/log at shutdown. But as it seems there is much
simplier way, I will then investigate.


Cheers.
 
Old 06-20-2012, 09:12 AM
Jesse Jaara
 
Default back up /var/log before shutdown

There is a directory syncing daemon in AUR it does exactly what you want.
Dir-sync-daemon is the name if I remember correctly.
 
Old 06-20-2012, 09:23 AM
Gaetan Bisson
 
Default back up /var/log before shutdown

[2012-06-20 11:08:37 +0200] Arno Gaboury:
> I fully understand these 3 lines, and thought it was not a
> complicated way to back up /var/log at shutdown. But as it seems
> there is much simplier way, I will then investigate.

I did not say those three lines were complicated; quite the opposite. My
point was that if you cannot understand them, you should not be doing
anything involving partitioning, experimental file systems such as
BTRFS, etc.

But since you do understand them, you can determine for yourself whether
they actually are an acceptable solution to your problem.

Cheers.

--
Gaetan
 

Thread Tools




All times are GMT. The time now is 06:08 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org