Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - statmonkey

Pages: 1 [2]
16
Zenity & Yad / Simple Rsync of Dirs
« on: September 26, 2013, 07:06:42 PM »
I'll start with one I use a great deal.  It is part of a more complex script that I will post later that does a routine of things but one of the great things about these is you can really cut and paste them back and forth the codlets once you have a few are easy to build off (actually yad more so) but that is again another subject.

So this little guy sits in my sbin and is a menu choice and has a key combo as well and when I want to (for example) start deleting half my root drive.  I just pop this open, back the bad boy up and then play havoc to my hearts content.

Code: [Select]
#!/bin/bash
#/==========================================================================
# TITLE: Backup
# AUTHOR:Statmonkey
#
# USAGE: Rsync and directory anywhere or the media directories
# DESCRIPTION: Graphical backup script using zenity

# ARCHIVE DATA USING Rsync and Zenity
# Allows you to select your source and destination
# Allows you to select your exclude filelist from a preset set of lists (this is in full script)
# Uses logger to log to syslog and logs everything in detail to a sourcelog which is rotated every run (full script)
# Allows auto setting rsync options, deletes files not on source and asks for deletion confirmation (full script)
# Presents use with a summary of a dry run (dry run does not include excludes)   
#
# Requires: exclude file in source, zenity, rsync
#
#         
# DATE: LAST UPDATED 9/25/2013 THIS IS ABBREV. FOR QUICK BACKUP USAGE
#==========================================================================
#
#
# SOURCE and DEST variables are defined thru GUI
###############################################
# Define Log Variables:
###############################################
# write to syslog the overall log that records what? FIXME
SYSLOG="/var/log/syslog"
echo $SYSLOG

###############################################
# Define DATE
###############################################

TODAY=`date +%m_%d_%y`

# Refer to closing lines of script for output
echo "The script Backup is starting"

#####################################
# Allow for a simple rsync
#####################################
zenity --question --title="Simple Backup" --text="Did You want a simple backup? Else, Quit!" --ok-label="Yes"
if [[ $? == 0 ]] ; then
SOURCE=`zenity --file-selection --directory --title "Select directory for source"`
echo $SOURCE
DEST=`zenity --file-selection --directory --title "Select directory for destination"`
echo $DEST
rsync -av "$SOURCE" "$DEST"
logger "Backed up $SOURCE $DEST"
echo "did backup $SOURCE $DEST $TODAY" >> $SYSLOG
exit 4
fi
# This ends the simple sync section. 
exit 4
##########

There are a few inefficiencies here and imperfections there but it meets my needs and the fun is it does what I want and I did it.  That is as much a part of the experience for me as anything else.  If anyone has a script they love, I would love to see it.  Even if not perfect the journey is the goal in this case.

17
Zenity & Yad / makethumb - Zenity script for burning images to USB
« on: September 26, 2013, 06:56:03 PM »
Not sure if there will be any interest in this but I have over time collected or put together quite a few zenity (and yad for that matter) scripts.  I thought that we might start something on the order of the bash aliases and collect a few of these that would help people have an idea of how to use them, or inspire some new creation, etc.  If their is interest I will post some of my yad scripts but I think zenity is probably more in regular use and after all there is very little top level difference between the two.

Post any scripts you like, loathe, etc. here.  I would love to see your work and good and bad I think it is how I learn best.

18
My previous OS used an UEFI boot and a gpt partition table but my mobo bios allows for both UEFI and legacy bios boot.  I really hadn't paid much attention to this until I went to install Vsido and it failed. 

It was failing at the step where the install was asking the user to select the swap partition.  This was even though I had set up a swap partition in gparted.  After repeatedly reformatting the partitions to have larger swap partitions it finally dawned on me that perhaps I needed to try another method.  What follows is what eventually worked for me.

 This should work on any setup that offers UEFI and boot bios legacy.  If you are on a pure UEFI system you will have to create a UEFI mbr as http://semplice-linux.org/doku/semplice:users:uefi  (ps good luck with that I got it to work on one box but it required a lot of TLC, also see this thread http://vsido.org/index.php/topic,322.0.html )  But most people should be able to use the following.

Notice: This solution expects that the drive you are planning on using for the install has been properly backed up.  Following this procedure will delete all data on the device.  REPEAT this will remove all that is on the drive.  If you haven't backed it up do so before proceeding.

Issue:

During the install when it comes to setting up the disks the Vsido installer does not see the swap partition even though it has been created in gparted, the result being the install screen will keep sending you back to set up a proper swap partition.  In this case a proper swap partition is one that isn't part of a gpt partition table.

Solution:

Change to a msdos partition table. 

  • To do so move through the install as normal until you get to the drive selection steps.
  •   Select the drive you want to install Vsido on, gparted will open to that drive.  Now we just have to create a new partition table
  • You should still be in gparted, select the drive that you want to use and highlight it. (It's probably already selected)
  • Then select Device from the gparted menu pulldown and select "Create Partition Table"
  • Gparted will prompt you with a "WARNING: This will ERASE ALL DATA on the ENTIRE DISK /dev/sdX" and "Default is to create an MS-DOS partition table" pop up.  This is exactly what we want.  In the lower corner select apply and the device will now show as a single drive unallocated in the gparted screen.

     At this point you no longer have a gpt partition table (which is what UEFI uses) and our problem is pretty much solved. 
The rest of the steps are as normal. 
  • Select Partition and create your new root and swap, plus home and whatever other partitions you want and then when you have it like you want select Apply.
  • Before closing gparted I always right click on my root partition and select "manage flags" and make sure that the system has a check in "boot" so it knows what that partition is for.
  •   Then close gparted when you are satisfied.  The Live Installer will pop up and this time present you with the partition that you set as swap.  Just select it and press OK.
  •   From there move on to complete the install.
    • I am not sure whether there are better ways to do this or not.  I did wrestle with the UEFI direct boot method but ran into two problems. 1. Any changes to grub at all resulted in the flashing cursor of death in the boot process. 2. The only way I could get it to boot was to write a script that I put in the UEFI mbr telling it where to look and what to do and when I started thinking about rewriting the bios to see that script automatically I realized what a black hole I was headed into.  But I did think about it .... that's crazy.


19
Feedback & Suggestions / General Observations
« on: September 06, 2013, 07:34:43 PM »
Firstly just an outstanding job overall.  Fairly amazing that I was feeling like I just wanted to have a Sid setup that had all the things I wanted right off the bat.  Started reading about Vsido, downloaded, installed, played with it, loved it and then came on the boards and saw that VastOne was behind it all.  I should have known :)  As a former #!er I appreciate how well thought out and simple it all is.

My initial install was pretty flawless once I got over a small issue that has nothing to do with Vsido.  My box is a dual UEFI/Legacy box and I was using a GPT partition prior to this.  The install kept failing on the swap partition.  After running around for a while I finally "got it" and reformatted the boot and swap partition to msdos.  After that it skipped through the install like magic, so fast I think it broke my old aptosid install to working system record.

The next issue I came across was the GMB-git setup did not like my customized/bastardized VastOne layouts and profile.  I was forced to change over to the standard GMB obviously this took only seconds.  I doubt anyone has the same sort of music goofiness I have so not to worry.  I also found that all of my devices barring a bluetooth driver were all set up.  I only had to add the bluetooth driver and of course switch over to HDMI sound and I had a fully running layout without all the cruft to remove as in other distro's.  Having spacefm and geany right there are great.

I only now have a couple of annoying things.  One is that my root mail is set to root@VastOne.  Nothing personal but I would rather not be reminded of your awesomeness everytime I get a system mail.  I once knew how to fix that but have long since forgotten.  Still researching that one.

Also, I guess I have a question.  How are you doing upgrades.  My first Sid distro was Aptosid as mentioned above and I got in the habit of going to init3, shutting down the X environ and running dist-upgrade.  This is the first time I have really run smxi and not sure of the steps or consequences of upgrading the kernel as part of the upgrade.  Researching this now sure that google will be my friend.

Overall impressions.  Wow, just what it needs to be.  Great install process, nice looking kit, everything included that I would install on my own.  Not much to add after initial boot, etc.  I'm sold. As usual VastOne, stellar performance.  Thank you for making this available.

Pages: 1 [2]