Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › echo "The `uname` Club" (NEW POLL)
New Posts  All Forums:Forum Nav:

echo "The `uname` Club" (NEW POLL) - Page 177

Poll Results: How long have you been using your current, main installation?

 
  • 24% (50)
    less then a month
  • 23% (47)
    less then six months
  • 14% (30)
    less then a year
  • 24% (49)
    less then three years
  • 13% (27)
    three years+
203 Total Votes  
post #1761 of 4043
Quote:
Originally Posted by Plan9 View Post

yeah, change the groups gid, then the gid of the user

with regards to the rsync, since you're copying from a laptop which means you may not be home or wireless might be playing up, etc, you don't want NFS always on and you want to check that your server is contactable before even attempting the rsync.

I'll change the groups today, why do I not want NFS on always? I put a line in fstab so it mounts when I turn the laptop on, do I not want this for security reasons?
Quote:
Originally Posted by Plan9 View Post

Something like this should do the job:
Code:
#!/bin/bash

server='192.168.1.100'# server ip
mntsrc='/path/to/directory'# server directory to mount
mntdest='/mnt/rsync'# laptop destination for the mount
baksrc='/home/user'# location of data to back up

ping -W 2 -c 1 $server > /dev/null
if [ $? -eq 0 ]; then
mount $server:$mntsrc $mntdest
mkdir -p $mntdest 2> /dev/null# it doesn't matter if it already exists, so no point erroring
mkdir -p $mntsrc 2> /dev/null # it doesn't matter if it already exists, so no point erroring
rsync -az --delete --progress $baksrc $mntdest
umount $mntdest
else
echo "ping failed. exiting"
exit 1
fi

It's a little over the top, as in you could probably write the same script in about 5 lines. But you can adapt that to suit your needs.

That looks awesome and pretty much exactly what I wanted, thanks Plan. If I use the --backup option with Rsync I would not use --delete option correct? And is there a way to limit the number of backups there are, like
Code:
if(backups > 2)
   delete oldest backup
else
   backup
post #1762 of 4043
Quote:
Originally Posted by thestraw0039 View Post

I'll change the groups today, why do I not want NFS on always? I put a line in fstab so it mounts when I turn the laptop on, do I not want this for security reasons?
It's not a security issue, it's because fstab mounts on boot and if you use your laptop away from home, you're not going to be able to mount your server (ie you wont be on your LAN to connect to a LAN IP). So booting will hang for a couple of minutes while mount hands trying to connect.

Also, if like me you manage wireless through your desktop environment, it means that fstab will be mounted before you have a wireless connection. So in those situations booting will also hang for a couple of minutes even though you are at home
Quote:
Originally Posted by thestraw0039 View Post

That looks awesome and pretty much exactly what I wanted, thanks Plan. If I use the --backup option with Rsync I would not use --delete option correct? And is there a way to limit the number of backups there are, like
Code:
if(backups > 2)
   delete oldest backup
else
   backup
Something like this might work
Code:
#!/bin/bash

server='192.168.1.100'          # server ip
mntsrc='/path/to/directory'     # server directory to mount
mntdest='/mnt/rsync'            # laptop destination for the mount
baksrc='/home/user'             # location of data to back up
nbaks=3                         # number of backups to retain

ping -W 2 -c 1 $server > /dev/null
if [ $? -eq 0 ]; then
        mount $server:$mntsrc $mntdest
        mkdir -p $mntdest 2> /dev/null       # it doesn't matter if it already exists, so no point erroring
        $i=0
        [ -d $mntdest/backup.$(($nbaks-1)) ] && rm -Rf $mntdest/backup.$(($nbaks-1))
        while [$i -le $nbaks]; do
                mv $mntdest/backup.$i $mntdest/backup.$(($i+1)) 2> /dev/null
                $i=(($i+1))
        done
        mkdir $mntdest/backup.0
        rsync -az --delete --progress $baksrc $mntdest/backup.0
        umount $mntdest
else
        echo "ping failed. exiting"
        exit 1
fi

i've not testing it though, you'll have to go through at test / debug where necessary. But basically each new backup going into a sub-directory named backup.0 and all the older backups are called backup.1, backup.2 and so on. The higher the number, the older the backup.

edit: oops, forgot to set the script to delete the oldest backup. fixed that

With regards to the --backup option, I've never used it personally so I could only tell you what man rsync says and I'm guessing you've already checked that?


edit2:
<rant>
reposted code to preserve indentation because the idiot developers that designed this crappy excuse for a forum cannot grasp the concept of not ****ing about with text inside code tags. I seriously wish OCN would give up trying to fix Huddler and switch to something which didn't massively suck at every given opportunity.
</rant>
Edited by Plan9 - 11/30/13 at 9:25am
post #1763 of 4043
Quote:
Originally Posted by Plan9 View Post

It's not a security issue, it's because fstab mounts on boot and if you use your laptop away from home, you're not going to be able to mount your server (ie you wont be on your LAN to connect to a LAN IP). So booting will hang for a couple of minutes while mount hands trying to connect.

Also, if like me you manage wireless through your desktop environment, it means that fstab will be mounted before you have a wireless connection. So in those situations booting will also hang for a couple of minutes even though you are at home.

Haven't run into that yet because I haven't had the laptop of the LAN since I mounted it, I'll just mount it manually when I need it.
Quote:
Originally Posted by Plan9 View Post

With regards to the --backup option, I've never used it personally so I could only tell you what man rsync says and I'm guessing you've already checked that?

Yea I read the man page said, still wasn't clear about it so figured I'd ask if you used it, I'll have to start experimenting with it and see what it does.
Quote:
Originally Posted by Plan9 View Post

edit2:
<rant>
reposted code to preserve indentation because the idiot developers that designed this crappy excuse for a forum cannot grasp the concept of not ****ing about with text inside code tags. I seriously wish OCN would give up trying to fix Huddler and switch to something which didn't massively suck at every given opportunity.
</rant>

Lol, didn't mean to get you all fired up, my bad.
post #1764 of 4043
Quote:
Originally Posted by thestraw0039 View Post

Lol, didn't mean to get you all fired up, my bad.
It's not you, it's this crappy forum software. Some days it just pisses me right off.
post #1765 of 4043
Quote:
Originally Posted by Plan9 View Post

It's not you, it's this crappy forum software. Some days it just pisses me right off.

I tried your script and have run into some issues, to mount the NFS share I need to be root. If i run sudo ./Script I mount no problem but I get permission errors with Rsync because root on the client doesn't have read/write permission on the server. I split it into two scripts, one to mount and one to run Rsync, and now it works great, but curious if there is a way to combine them into one script to get around the permission problems?
post #1766 of 4043
Quote:
Originally Posted by thestraw0039 View Post

I tried your script and have run into some issues, to mount the NFS share I need to be root. If i run sudo ./Script I mount no problem but I get permission errors with Rsync because root on the client doesn't have read/write permission on the server. I split it into two scripts, one to mount and one to run Rsync, and now it works great, but curious if there is a way to combine them into one script to get around the permission problems?
There's a few ways you can do that. The easiest might be to run the script as root but sudo each command that writes to the share. eg
Code:
sudo -u user rsync source destination
sudo -u user mv file.backup.0 file.backup.1
sudo -u user mkdir -p /path/to/directory

The other easy option is having no_root_squash for the backup NFS share (normally it's not advicable to allow root access over NFS, but it needn't be insecure if you've limited the directory that root has access to)
Edited by Plan9 - 12/1/13 at 6:15am
post #1767 of 4043
So I decided to try LMDE cinnamon edition. The installation went well, but I think I am having major driver issues. After installation I was unable to boot to the GUI, after hitting CTL ALT F1 I was able to a shell where I was able to log in and do a sudo apt-get update && sudo apt-get upgrade. There it installed a huge amount of updates (1000, which I thought was odd because I just downloaded the .iso) but when I restarted I still was unable to load the GUI. After doing some Googling I found this, which by adding i915.modeset=0, to a line in GRUB got me to boot GUI in software rendering mode. Now sometimes when I start up the GUI won't boot at all, sometimes in software rendering mode, and sometimes it will boot normally.

After much Googling I have figured out it is something with Intel's graphics driver and Linux mint. It also looks like it's specific to Cinnamon, so I downloaded the LMDE mate .iso and may try installing mate and see what happens. Anyone have any experience with this? Here may be some useful outputs? I have no idea where to go from here, so I figured I'd ask here before I scratch LMDE Cinnamon.
Code:
dan@danlaptop ~ $ cat /etc/*-release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=1
DISTRIB_CODENAME=debian
DISTRIB_DESCRIPTION="LMDE Cinnamon Edition"
PRETTY_NAME="Linux Mint LMDE"
NAME="Linux Mint LMDE"
ID=linuxmint

dan@danlaptop ~ $ lspci |grep VGA
00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (primary) (rev 0c)

dan@danlaptop ~ $ lspci -nnk | grep -i vga -A3 | grep 'in use'
Kernel driver in use: i915
post #1768 of 4043
I have a similar issue with the same Intel chipset on Arch Linux running KDM / KDE4.

About 1 in 4 times the system will just hang on a blank screen - [ctrl]+[alt]+[del] will shutdown and restart the laptop and it will then power up correctly. It only happens when I have a graphical boot screen too - if I have plain scrolling text, the system boots fine every time. Also switching TTYs (like you did) and restarting X / KDM causes the Xorg to start normally. So I think it's something to do with a race condition with different frame buffers or something - where the graphical boot screen doesn't release the graphics driver in time for the login / display manager. However I've not done much investigation other than the aforementioned so I'm not sure how to fix it (aside turning off the graphical boot screen).
post #1769 of 4043
Quote:
Originally Posted by Plan9 View Post

I have a similar issue with the same Intel chipset on Arch Linux running KDM / KDE4.

About 1 in 4 times the system will just hang on a blank screen - [ctrl]+[alt]+[del] will shutdown and restart the laptop and it will then power up correctly. It only happens when I have a graphical boot screen too - if I have plain scrolling text, the system boots fine every time. Also switching TTYs (like you did) and restarting X / KDM causes the Xorg to start normally. So I think it's something to do with a race condition with different frame buffers or something - where the graphical boot screen doesn't release the graphics driver in time for the login / display manager. However I've not done much investigation other than the aforementioned so I'm not sure how to fix it (aside turning off the graphical boot screen).

I'll try to turn off the graphical boot screen, how do I do that? Also my system doesn't feel as "snappy" as it did on Ubuntu, I have no idea how to check logs to see if I am running into any other issues, besides this. Recommend any sites to learn about reading logs, I'm guessing the Arch Wiki has some good stuff, but that ends up being over my head a lot of times.
post #1770 of 4043
Quote:
Originally Posted by thestraw0039 View Post

I'll try to turn off the graphical boot screen, how do I do that?
Not sure in mint, but it might be just a simple case of deleting "splash" from the kernel line in your GRUB config (/boot/grub/menu.lst). Don't take this as gospel though because I've not used GRUB2 much nor Mint.
Quote:
Originally Posted by thestraw0039 View Post

Also my system doesn't feel as "snappy" as it did on Ubuntu, I have no idea how to check logs to see if I am running into any other issues, besides this. Recommend any sites to learn about reading logs, I'm guessing the Arch Wiki has some good stuff, but that ends up being over my head a lot of times.
This is easy, just view anything in /var/log/ with a text editor. You may even be able to read the log files without root permissions (some systems grant read access). For now, I'd focus on files called something like "messages".

Also, some stuff will show up in dmesg (literally just run dmesg in the command line).

However I think the cause of your problems are more likely memory orientated. What's the output of free -m
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › echo "The `uname` Club" (NEW POLL)