Ubuntu :: Bash Script - Run Different Rsync Cmds Based On Which Devices Are Mounted

Apr 2, 2010

having my data backed up properly, but it's also in different places (e.g. photos and music on separate flash drives), so I have a few rsync's that I can execute manually, drives are mounted. Unfortunately, it gets confusing very quickly, I'd like a simple bash script that goes something like this (this pseudo-code would be most like REXX):

pair.1 = (/dev/sdb1, /dev/mmcblkp01)
pair.2 = (/some/other/device, /yet/another/device)
for i = 1 to #pairs

[code]....

Seems simple enough, but I've never written a bash script and wouldn't know where to start.

View 5 Replies


ADVERTISEMENT

Ubuntu :: Drives Mounted To Different Devices On Startup?

Apr 30, 2010

My computer has three drives: one with windows7,one as a storage drive, and an ide drive. I have ubuntu 10.04 installed on a seperate partition on the storage drive (+swap partition).I have "/etc/fstab" automatically monut these drives on startup:

Code:
/dev/sdc1 /media/win7 ntfs-3g quiet,defaults,rw 0 0
/dev/sdb1 /media/storage ntfs-3g quiet,defaults,rw 0 0

[code].....

View 4 Replies View Related

OpenSUSE :: How To Recognize Mounted Devices

Apr 13, 2010

I have recently mounted my iPod Touch using ifuse, and it works with gtkpod and I'm very pleased about that! However, I'm interested in finding out how openSUSE recognises what devices are mounted? Because the device manager in the task bar doesn't recognise that it's mounted... Dolphin doesn't recognise it and neither does Amarok. Only gtkpod, which is good, but I want other applications to recognise it. Do I need to mount it in a specific location? Currently it's at /mnt/iPhone. Or do I need something in fstab (I'm just guessing here).

View 1 Replies View Related

Ubuntu :: Change Default Permissions On USB Mounted Devices

Mar 8, 2011

I have a few websites that travel along with me in my usb stick, and I want to have read and write permisions to files on my usb by other users (i.e.: www-data) actually they have 0700. I'm running maverick (linux mint Julia).

View 1 Replies View Related

Ubuntu :: USB Devices Arnt Mounted On Boot NATTY?

Apr 29, 2011

last 3 rounds of updates to my Lucid system produced various problems, though each a solution to the previous issue. So I decided to upgrade to natty, and get new problems. LOL.

SO, my USB mouse and keyboard no longer mount on boot. If I unplug the keyboard and mouse, then re-insert them, they work fine.

View 2 Replies View Related

General :: One Of LVM-based Partition Cannot Be Mounted

Jul 6, 2010

I'm using LVM-based partitioning. I can not mount one partition. Here is some information I can provide.

Untitled-1.png
snapshot7.png
snapshot8.png

This incident happened after I try to encrypt this partition and then an error message appears. If not mistaken, it contains an error number (I forget) and a warning which reads that can not remove the LABEL on the devices.

View 1 Replies View Related

OpenSUSE Install :: 11.1 - Two Devices Mounted On One Directory

Jan 11, 2010

I have 3 disks in my PC which are partitioned equally as I use them for Raid 1.The first partition on every disk is a simple ext2 partition for booting. No Raid there. So I mount them as /boot and /boot2 and /boot3. So I can backup my /boot to the other boot directories. That worked for some month and this morning I just want to look if all directories have enough free space left. So I did a df -h and got this:

Code:
Dateisystem Grove Benut Verf Ben% Eingehängt auf
/dev/mapper/system-root
6,0G 301M 5,4G 6% /
udev 1,5G 292K 1,5G 1% /dev
/dev/sdb1 122M 29M 87M 25% /boot
/dev/sdc1 38M 21M 16M 59% /boot2
...
/dev/sda1 122M 29M 87M 25% /boot
As you can see /dev/sda1 and /dev/sdb1 are both mounted on /boot

Here is what mount says:
Code:
/dev/sdb1 on /boot type ext2 (ro,acl,user_xattr)
/dev/sdc1 on /boot2 type ext2 (ro,acl,user_xattr)
...
/dev/sda1 on /boot type ext2 (ro,acl,user_xattr)

This is no Problem for me as I could just remount it correctly, but I would like to know if this problem is known. I did not change anything by now and this PC is a server which is running 24/7, so I can deliver more debugging Information if someone is interested.

View 9 Replies View Related

Ubuntu :: Mounted Devices Not Showing In Dolphin Places List

Jan 16, 2011

This is probably me looking but not seeing an option somewhere. I re-installed 10.10 over 10.04 by formatting the root partition but keeping the home partition the same, to save me a lot of work. (64 bit) However, now when I mount a CD, DVD or USB stick, they don't appear in Dophin's "Places" window. What have I missed please?

View 2 Replies View Related

Debian Multimedia :: Banshee 1.6 - Android Devices Not Mounted

Dec 28, 2010

I have a sony x10mini and it is correctly seen in nautilus and shotwell. But nor in banshee 1.6 (testing and sid) nor in 1.9 (experimental) is mounted. Fact is that I know it works for sure in fedora and debian so I wonder if it a problem of some dependency missing, configuration or permissions. I use the testing distro by the way...

View 11 Replies View Related

OpenSUSE Hardware :: KDE Mounted Devices Sometimes Do Not Remove Folder

Aug 29, 2010

When booting opensuse 11.2 or 11.3 there is automatically created a folder in /media to mount my external usb drive (in /media/disk). The problem I have is that sometimes these folders are not automatically removed when I shut down. On the next time boot this device is mounted at /media/disk-1 or /media/disk-2 which throws off for instance Krusader or Amarok. Also the folders that are not removed seem to have really strong permissions such that I can't even browse into them in Krusader or Dolphin. I have to manually clean the /media folder as super user so that when I reboot, they are in /media/disk. Does anyone know how to ensure that opensuse removes the folder(s) upon shutdown?

View 8 Replies View Related

Debian :: Removable Devices Auto-mounted As Read-only?

May 29, 2010

Quote:

Currently when I insert a removable device, it is auto-mounted as readonly. To use it I have to do this every time.

Code:

sudo umount /dev/xxx
pmount xxx

This applys to every removable device I have, and did not exist on my previous distro. Debian amd 64 Squeeze [URL]

View 5 Replies View Related

General :: Displaying Mounted Devices - Incorrect Info?

Feb 11, 2011

Sometimes when I try to display the mounted device in linux it displays devices which are not currently mounted. I want to correct this this using script.

View 1 Replies View Related

Debian :: How To Find Out Mounted Devices Loaded At Boot Time

Apr 20, 2010

I am trying to find out the command to list all the devices mounted at boot-time.

View 5 Replies View Related

Software :: Access The Serial Management Consoles Of Various Hardware Devices Via Browser - Java Based

May 22, 2010

Is there any Linux software that allows accessing a pre-configured serial console via Browser using a java applet? I would like to access the serial management consoles of various hardware devices via browser.

View 1 Replies View Related

Ubuntu :: Rsync Bash Script Different In Cron?

Feb 19, 2010

I've got a bash script that uses rsync via SSH to back up data from a remote webserver.
This script works fine when I run it myself but when it runs as a cron job I get the following error:

Code:
2010/02/20 08:15:01 [6786] Unexpected remote arg: user@www.server.com:~/www
2010/02/20 08:15:01 [6786] rsync error: syntax or usage error (code 1) at main.c(1219)

[code]....

View 9 Replies View Related

Programming :: Rsync Bash Script With Progress Bar?

Apr 26, 2009

I'm writing a script to automate rsync backups which so far is working great. I prefer to send output to a text file instead of watching it fly by but the blank output is slightly boring? I would love to use a progress bar. Not for each file but for overall progress. Something like

syncing /home directory 50% [++++++++]

I already know it's way over my head and maybe bash isn't even the right tool for the job.

View 4 Replies View Related

General :: Constantly Check Whether A Cd Is Mounted Or Not Using Bash?

Mar 20, 2010

i need to check if a cd is mounted or not using bash ... how is that possible?

View 8 Replies View Related

Slackware :: Check If Device Is Mounted In A Bash Script?

Aug 1, 2010

Writing a bash script and I need to check if a known HD partition is mounted or not. I do not think /etc/mtab is the place to check. Would /proc/mounts always work? To make it simple like this : cat /proc/mounts | grep /dev/sdb2

View 5 Replies View Related

Debian :: Auto-mounted Truecrypt Partition (keyfile Based) - Can't Add A Keyfile To The Volume Using The GUI

Nov 18, 2010

I have a Truecrypt-encrypted Windows [system] partition, that I want to be opened and mounted automatically (using a keyfile) when I log into Debian, since it is also encrypted and I don't want to type two passphrases. It think this could be done with LUKS. With TC I probably have to go with the CLI, but haven't figured it out yet. And I can't add a keyfile to the volume using the GUI. In order to mount the volume I have to tick the Mount partition using system encryption (preboot authentication) checkbox, or otherwise I get Incorrect password or no TrueCrypt volume found. And same when I try to add a keyfile.

View 2 Replies View Related

Debian :: Bash Script Based On Time Of Day

Mar 25, 2016

I'm trying to get a bash script to do different things based on the time of day, but at least once a day the test fails:

Code: Select allNOW=$(date +%k%M)
if [[ "$NOW" -ge 1000 ]] && [[ "$NOW" -le 2200 ]];then
        alarm lon
else
        alarm loff
fi

This is the error, and line 59 is the second quoted above:

Code: Select all/home/electrolux/bin/ts.sh: line 59: [[: 059: value too great for base (error token is "059")

The script is run every minute, and this error only occurs at 12:59AM, or 00:59.

I presume the problem is either $NOW is being set to 059, or the testing is seeing 0059 as 059. I think the latter, because for the rest of midnight 'til 00:58 the script works. And with some Googling it seems that the leading 0 is making test treat the number as octal... is there a way to tell it it is decimal?

Perhaps this is just some poor time-testing code? Looking at it I don't think it will cope with set time period that crosses midnight..... there's probably just a command to do what I want, isn't there? I know I could have two different scripts cron'd for the different time periods, but it would be much more preferable to be just the one.

View 4 Replies View Related

Programming :: Bash Script In Based Hosting?

Apr 4, 2010

i have a question in my mind.sorry if its irrelevant to this topic.Can i run bash script (which i currently run on cygwin) in linux based web hosting?

View 2 Replies View Related

Ubuntu Installation :: RAID / LVM Cmds To Migrate To Larger Drives?

Sep 27, 2010

how to migrate my whole server to larger hard drives (i.e. I'd like to replace my four 1TB's with four 2TB's, for a new total of 4TB instead of 2TB)... I'll post the output from everything (relevant) that I can think of in code tags below.

I'd like to end up with much larger /home and /public partitions. When I first set up raid and then LVM it seemed like it wouldn't be too hard once this day arrived, but I've had little luck finding help online for upgrades and resizing versus simply rebuilding from a failure. Specifically, I figure I have to mirror the data over to the new drives one at a time, but I can't figure out how to build the raid partitions on the new disks in order to have more space (yet mirror with the old drive that has a smaller partition)... don't the raid partitions have to be the same size to mirror?

Ubuntu Server (karmic) 2.6.31-22-server #65-Ubuntu SMP; fully updated

Code:
cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md5 : active raid1 sdd5[1] sdc5[0]
968952320 blocks [2/2] [UU]

[Code].....

View 3 Replies View Related

Ubuntu Installation :: Error - Execute Some Grub Cmds From Terminal?

Oct 31, 2010

I had hard drive = 2 partition, 1 being extended. I had two ubuntu instances+swap+fat on extended and XP on primary. I moved a partition = success. I create a new partition = success. I installed new ubuntu instance -> fail on restart->. I saw sector error on screen on restart. So, Grub has lost 1 existing ubuntu instance and could not create new entry for new ubuntu instance. Read on forum just boot from Live CD and execute some grub cmds from terminal?

View 5 Replies View Related

General :: Bash Script Rename Files Based On Directory Name?

Mar 26, 2010

I'm pretty new to bash scripting, but I really want to wrap my head around it.What I'm trying to do is: From directory "A": Go in to all subdirectories and rename all files within icrementally according to the directory name. SO:

|-- Varian
| |-- FB1-page132.pdf.png
| |-- FB1-page133.pdf.png

[code]...

View 7 Replies View Related

Programming :: Creating A Text Based Menu Structure In Bash?

May 15, 2009

Is it possible to create a text based menu layout in bash were it is possible to browse through. The menu list should look something like this:

----------------------------------------
user: root
colour: blue
number: 4
animal: dog
----------------------------------------

At the start the cursor should blink at the r from root so that text can be entered. When pressing the enter the cursor should go to the b from blue and so on. the imported thing is that all the text is visible also beyond the position from the cursor.

View 4 Replies View Related

Programming :: Bash - Calling A Specific Variable Based On User Input?

May 3, 2011

I'm trying to call a specific variable based on a user selection. For example:

Code: Select a file:

[1] foo.tar
[2] bar.tar

Enter a selection: I have already coded each possible selection to have its own variable. If the user selects 2 I need to select $SELECTED_TAR2, or if they select 1 I need to select $SELECTED_TAR1 and then do something like this behind the scenes:

Code: cp /home/user/$SELECTED_TAR2 /home/user/backup/$SELECTED_TAR2

I was thinking something like this:

Code: echo "Enter a selection: "
read -e SELECTED_NUMBER
cp /home/user/$SELECTED_TAR$SELECTED_NUMBER /home/user/backup

[code]....

View 2 Replies View Related

Programming :: Bash-code To Rename Files Based On Config File

Apr 12, 2010

I'm writing a bash shell script that among various other things will traverse through a directory with hundreds of files and rename those who match a pattern found in a config file. It's expected that only about one in ten files will actually match, and those who don't, will simply just be ignored for this purpose.

This should for instance cause the file "dBase program file December 1987.prg" to be renamed "Clipper source code December 1987.prg", and conversely "C++ source August 1996.cpp" to be renamed "C source code August 1996.cpp" etc.A sample file such as "Random Data File.dat" should not be renamed here since it's not mentioned in the config file..What is the quickest, most elegant way to do this in bash?I am thinking of using bash's built-in regex matching combined with the /bin/rename utility, but don't quite know how to get started to catch this..I guess there are plenty ways of doing this in perl and elsewhere as well, but since this has to integrate into a pre-existing bash script, that's what I'm looking for.Anyone out there with a spare moment to offer a hint in the right direction?

View 14 Replies View Related

General :: Bash - Use A Graphical Or Text Based EDITOR On Logging In Locally Or Remotely?

Aug 17, 2010

I can set my EDITOR variable in my .bashrc to e.g. gedit, which is a nice graphical editor on ubuntu. But when I log in over PuTTY that editor will fail.What is the best way to detect if I'm logged in and can run a graphical editor, or not, and set EDITOR appropriately?

View 2 Replies View Related

Programming :: Bash Script: Sort Files Into Directory Based On Data In The File Name?

Sep 28, 2010

I have very little linux experience. And need some help with a bash script. I need to a script I can set cron to run to sort files out of a holding folder into final folders. It doesn't necessarily have to be bash, but I think it would be sufficient for this. File names are formatted as such when created: Dest-Date-Time-CID-Destination# I want the files to be moved from a all in one holding folder to a folder structure like this.

.../storage/year/month/day/Destination#/VarX(type)/hour/CID/'File'

I would need an if/else if/else statement to say if Dest = A set VarX = B If for example the file name was

infinity-20100927-17:00-1112223333-4445556666.wav

I would like the above file to end up moved from

.../holding

to

.../storage/2010/09/27/4445556666/Inbound/17/1112223333/infinity-20100927-17:00-1112223333-4445556666.wav

So the script will need to make directories based on information in the file name which is delimited by single dashes. Then move files from the holding folder to the newly created "sorted" folders.

View 15 Replies View Related

Ubuntu Networking :: Run Cmds On Marc Greis Tutorial - Error "can't Find Ns: No Such Command"

Jun 9, 2010

Want to run some cmds on Marc Greis Tutorial but always gets an error msg- "can't find ns: no such command. How can I resolve it? Also do not know how to edit on the terminal Have to start afresh anytime I notice a mistake. How can I successfully run a file to get a result. Have not been able to reproduce the result in Marc Greis tutorials.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved