Tiny Core Linux

General TC => Programming & Scripting - Unofficial => Topic started by: ixbrian on August 21, 2010, 11:17:02 PM

Title: Idea for exittc (shutdown program) - add in checkbox to show backup status
Post by: ixbrian on August 21, 2010, 11:17:02 PM
If you do a backup while shutting down Tiny Core, the backup seems to take forever because there is no indication of what is going on.   From a user perspective standpoint, I think the backup at shutdown seems to go faster if you can see a list of files that are being backed up.   Plus, if you can see the list of files being backed up, you can easily identify large files that are slowing down the backup. 

I have made some minor modifications to exittc.fl so that there is a checkbox that the user can select if they would like a terminal to pop open during the backup at shutdown so that they can watch the progress.   

The updated exittc.fl is attached to this message.

Thanks,
Brian
Title: Re: Idea for exittc (shutdown program) - add in checkbox to show backup status
Post by: tinypoodle on August 22, 2010, 01:54:04 AM
Would it be easy to have such a feature for backup even when not done upon shutdown?
Title: Re: Idea for exittc (shutdown program) - add in checkbox to show backup status
Post by: ixbrian on August 22, 2010, 11:29:50 AM
Would it be easy to have such a feature for backup even when not done upon shutdown?

Yes it would.   If this is something that would be accepted, I can update the filetool app to also include a check box that would pop open a terminal to display the backup/restore status.   

Brian
Title: Re: Idea for exittc (shutdown program) - add in checkbox to show backup status
Post by: TaoTePuh on August 22, 2010, 01:36:19 PM

Quote
Plus, if you can see the list of files being backed up, you can easily identify large files that are slowing down the backup.

To get a list of files in your backup sorted by size this can perhaps be helpful :

Code: [Select]
tar tvzf $(cat /opt/.tce_dir)/mydata.tgz | sort -n +2 -3
Title: Re: Idea for exittc (shutdown program) - add in checkbox to show backup status
Post by: tinypoodle on August 22, 2010, 02:16:15 PM
Code: [Select]
tar: can't open '/tmp/tce/mydata.tgz': No such file or directory
I think that would be defining location of backup by location of extensions which in default mode (as here the case) is /tmp/tce/
Title: Re: Idea for exittc (shutdown program) - add in checkbox to show backup status
Post by: roberts on August 22, 2010, 02:38:32 PM
IMHO doing a list upon exit is too late. Doing it while attempting a backup is too late.
Reviewing an existing mydata.tgz is too late. This topic has been discussed much since I first created these scripts in 2003.

Typically, it is in HOME that files accumulate that you may not be aware that will cause an attempted backup to either take very long to complete or possibly even fail.

To see large files residing in your home you can use:
find /home/tc/ -type f -size +1M | xargs ls -lhS

I will add a tab to system stats to report big files.
Title: Re: Idea for exittc (shutdown program) - add in checkbox to show backup status
Post by: TaoTePuh on August 22, 2010, 02:57:23 PM
@tinypoodle

Okay, I have seen in filetool.sh that you must run some effort to determine (universally valid) the path to mydata.tgz. No chance for me to formulate this as a one-liner.

So I make myself easy, and correct me like this :

Code: [Select]
tar tvzf /PATH_TO_YOUR_BACKUP/mydata.tgz | sort -n +2 -3
 ;D ;D ;D
Title: Re: Idea for exittc (shutdown program) - add in checkbox to show backup status
Post by: tinypoodle on August 22, 2010, 03:17:29 PM

To see large files residing in your home you can use:
find /home/tc/ -type f -size +1M | xargs ls -lhS
Code: [Select]
tc@box:~$ find /home/tc/ -type f -size +1M | xargs ls -lhS
find: invalid number '1M'
Replacing '1M' by '1024k' appears to work.  ;)
Title: Re: Idea for exittc (shutdown program) - add in checkbox to show backup status
Post by: ixbrian on August 22, 2010, 03:20:15 PM
Would it be easy to have such a feature for backup even when not done upon shutdown?

Attached is an updated filetool.fl that includes an optional check box that will pop open a terminal that will show you the backup/restore status.  

I also had to make a minor change to filetool.sh (also attached) because currently it isn't possible to specify a backup/restore device without also implying the "noprompt" option.  

Brian
Title: Re: Idea for exittc (shutdown program) - add in checkbox to show backup status
Post by: tinypoodle on August 22, 2010, 03:21:54 PM

Code: [Select]
tar tvzf /PATH_TO_YOUR_BACKUP/mydata.tgz | sort -n +2 -3
Code: [Select]
tc@box:~$ tar tvzf /mnt/sda5/mydata.tgz | sort -n +2 -3
sort: invalid option -- '3'
Title: Re: Idea for exittc (shutdown program) - add in checkbox to show backup status
Post by: ixbrian on August 22, 2010, 03:25:18 PM
@tinypoodle

Okay, I have seen in filetool.sh that you must run some effort to determine (universally valid) the path to mydata.tgz. No chance for me to formulate this as a one-liner.

So I make myself easy, and correct me like this :

Code: [Select]
tar tvzf /PATH_TO_YOUR_BACKUP/mydata.tgz | sort -n +2 -3
 ;D ;D ;D


There is also this:   http://forum.tinycorelinux.net/index.php?topic=6979.0     It will show you the uncompressed size of your backup and what percentage each file in your backup is of the overall backup size. 
Title: Re: Idea for exittc (shutdown program) - add in checkbox to show backup status
Post by: ixbrian on August 22, 2010, 03:32:31 PM
IMHO doing a list upon exit is too late. Doing it while attempting a backup is too late.
Reviewing an existing mydata.tgz is too late. This topic has been discussed much since I first created these scripts in 2003.

I agree with you that it is too late upon shutdown to list your files in order to determine if you are backing up too much or incorrect files.    In my case, I know what is in my backup and it all needs to be there.   However, when I shutdown my computer the backup seems like it takes forever just because there is no visual indication that anything is happening.    For me, seeing the list of files being backed up on the screen changes the perception of how long the backup takes because I can see the status and progress. 

Thanks,
Brian
Title: Re: Idea for exittc (shutdown program) - add in checkbox to show backup status
Post by: TaoTePuh on August 22, 2010, 03:37:46 PM
@tinypoodle

Quote
tc@box:~$ tar tvzf /mnt/sda5/mydata.tgz | sort -n +2 -3
sort: invalid option -- '3'

I suspect here a restriction by the "busybox sort".

A "tce-load -i coreutils" in front of the command should fix this ...


EDIT, to love of completeness, so it works with the "busybox sort" and the "corutils sort"

Code: [Select]
tar tvzf /PATH_TO_YOUR_BACKUP/mydata.tgz | sort -k 3n,4
Title: Re: Idea for exittc (shutdown program) - add in checkbox to show backup status
Post by: tinypoodle on August 22, 2010, 05:17:51 PM
That works, thanks.  ;D
Title: Re: Idea for exittc (shutdown program) - add in checkbox to show backup status
Post by: roberts on August 22, 2010, 10:35:42 PM
Quote
currently it isn't possible to specify a backup/restore device without also implying the "noprompt" option.

Hmmmm, works as expected displaying the files with a prompt at completion;
 filetool.sh backup "" sda1/tce
Title: Re: Idea for exittc (shutdown program) - add in checkbox to show backup status
Post by: ixbrian on August 22, 2010, 10:38:23 PM
Quote
currently it isn't possible to specify a backup/restore device without also implying the "noprompt" option.

Hmmmm, works as expected displaying the files with a prompt at completion;
 filetool.sh backup "" sda1/tce

I didn't think of trying to specify "" as the second argument to filetool.sh; good idea.   

Brian