Ubuntu :: Script Supposed To Check If There's A Folder - Create If It's Not There
Jul 9, 2010
I have a script that takes a location and does something to them then creates new files in the supplied location. I was trying to get the script to create the location if it didn't exist, but i can't figure out why it won't work. Here's what i've got right now
Code:
#!/bin/bash
destdir=$1
[[ -z "$destdir" ]] && { echo "No destination parameter supplied, exiting"; exit 1; }
[[ ! -e "$destdir" ]] && { echo "$destdir does not exist, exiting"; exit 1; }
[code]....
when i run the first one, it works if the supplied folder exists. If i try with my modification with a name such as /media/place/Foo bar, it creates a folder called Foo in the supplied dir, and bar in the dir i'm in when i run the script. the -p flag on mkdir creates parent directories btw.
View 4 Replies
ADVERTISEMENT
Oct 29, 2010
I have this nasty habit of refreshing desktop in a quick succession by right-clicking and selecting 'Refresh',on my XP system at office.(And,iam sure most of us do the same).With Ubuntu,if a right-click on desktop slowly and select 'align by...',it simulates the XP refresh action as explained above.But,if i perform the same action rapidly,it takes this first option from right-click context menu,which is 'Create Folder',and results in an empty folder being created on desktop.I tried double right-clicking and again it created an empty folder.Is there any workaround to handle this.I mean:Can the right-click context menu items be shuffled so that the 'Create Folder' option is moved from 1st place
View 9 Replies
View Related
Oct 28, 2010
I'm new to ubuntu and want to install stepmania so i downloaded the binary, i want to put the files in the /opt/ directory, the only problem is i cant create a new folder, i tried dragging a ready-made file into it but it just says "you do not have the permissions to file:///opt/" Im soo sad i wanna play my sM NOW!
View 3 Replies
View Related
Feb 13, 2011
this is posable but am trying to do this "Create folder from a filename and move the file into the folder" i have 500000+ file's i need to do with is there a easy way?I really don't want to download them all make/move them with filemonkey just to re-upload them
View 2 Replies
View Related
Feb 10, 2010
How can I check if Ubuntu deletes all the content in /tmp folder at each shutdown
(without trial and error)?
How can I tell Ubuntu to delete it?
What about the deletion of other tracks like swapfile at shutdown?
View 6 Replies
View Related
Aug 31, 2010
This query is about Machine # 1 - Asus P5Q Deluxe, C2Duo 3.0GHZ, 4.0 GB ram, nVidia 8500, openSUSE 11.2 64-bit, KDE 4.3.5I am having a little concern about the way Dolphin file manager behaves in the 64 bit openSUSE and am wondering if there is a solution for it.Every file I download from the net goes into a 'Check' folder, and I check it over before moving it to it's proper place.In the 32bit version nSuse 11.2, I can watch files being downloaded to that 'Check' folder. I call this realtime file postingIn the 64 bit openSUSE 11.2, I have to close the 'Check' folder and reopen it to see the downloaded file, so, everytime I download something, I have to close and reopen the 'Check' folder. It does not post the file to the folder until the folder has been closed and reopened.I have checked the settings of both machines for Dolphin file manager and see nothing [apparently] different, yet this still persists.
View 9 Replies
View Related
Feb 14, 2011
I am trying to compress a folder and the contents within, while keeping the permissions the same. I then need to check if the compress file is corrupt or not. Base on that result I need to transfer the file.
cd /home/ops/Desktop/temp
tar cvzfp backup-"$(date +%d-%b-%y)".tar.gz /home/ops/Desktop/dir1
gunzip -tl backup-"$(date +%d-%b-%y)".tar.gz
View 2 Replies
View Related
Jan 14, 2011
I would like to make a script which can check my ISP connection, I have a dynamic IP and it seems that lately it often gets changed.
So I thought of making a script which does a NSlookup and send this to my root address. But it would be better if it only does this when it notice a disconnect otherwise I get loads of messages. I use a watchguard firewall and behind this I have my Ubuntu server which is also the DNS and DHCP server for my internal LAN. My watchguard makes a DSL connection with my bridged DSL modem. Also the watchguard has a logging system and I send the syslog to my ubuntu server but it's too much work to look everyday into this whole logfile system.Or would it be better to look into this logging files and search for a specific description and send only this to my root mail?
View 10 Replies
View Related
Aug 4, 2010
there is a folder. Its empty. When every I drag a new file and put into it it echo out "there is file in there" and keep monitoring the folder. How can I do it?
View 7 Replies
View Related
Nov 16, 2010
I have a script that checks a folder for zip files than moves them to a different folder. I want to check every 5 maybe 10 seconds and since cron is setup to run at least a 1 minute increment I'm not sure how to do that time check as probably a loop within the script. One other thing is once the time check is in the script how would a cron job be setup to run this script? Once the script is running cron doesn't need to run it again, is there a feature to check if it's running and if it's not then run it?
find /export/xxxshare -name "*.zip" -exec mv {} /export/store ;
View 3 Replies
View Related
Mar 30, 2010
I can't create a folder in the home directory. It seems I don't have the permissions to create a folder in my home directory. This is a new installation. I want to be able to create subfolders in my home folder. Also, I want to be able to modify configuration files in the etc folder.
View 9 Replies
View Related
Apr 20, 2010
when I try to create a folder in my USB drive I get this ..Error while creating directory untitled folder.There was an error creating the directory in /media/TRAVELDRIVE
View 4 Replies
View Related
Jun 14, 2010
I want to install matlab in Linux. I want to create a new folder in Applications . The problem is i cant find where this 'APPLICATIONS' location is.. Only after which can i proceed with CD and MKDIR commands.
View 2 Replies
View Related
Aug 23, 2010
I want to create a hotkey to create new folder in Ubuntu 10.04 the hotkey I want to use: ctrl shift n
Is it possible to this?
I'm guessing its going to involve remapping the keys somehow...
View 3 Replies
View Related
Apr 8, 2011
I cannot create folder or open some of the files in var/www. What to do so that I can create folder, read and write and execute files.
View 6 Replies
View Related
Jun 9, 2011
I have the 11.04 version.I've tried to run Ubuntu One from the Launcher, but it doesn't do anything, so I have to go to the terminal and write sudo ubuntuone-control-panel-gtk Once it runs, the window opens, and where it should say File Sync is up-to-date it appears in red letters this error:
File Sync error. (org.freedesktop.DBus.Error.Spawn.ChildExited: Process /usr/lib/ubuntuone-client/ubuntuone-syncdaemon exited with status 1), next to it I have the option Restart, but it doesn't do anything if I click it.
If I go to the section "Cloud Folders" it appears:
Value could not be retrieved. (DBus exception: org.freedesktop.DBus.Error.Spawn.ChildExited: Process /usr/lib/ubuntuone-client/ubuntuone-syncdaemon exited with status 1) The folder Ubuntu One that should appear in my Home Folder, doesn't exist.
View 1 Replies
View Related
Sep 16, 2010
I have set up Ubuntu 10.04 with a data partition mounted as /share that I would like to make available to all users. I have only managed to do this so far by using chmod and chown, can I flag the folder so that all users can read and write from it automatically? I'm looking for something a bit like "Ignore Ownership" on a Mac.
View 3 Replies
View Related
May 17, 2010
i'm using ubuntu 9.04 jaunty jackalope for my drupal development. last one day before i lose my www folder in my ubuntu system. and i had LAMP Server with phpmyadmin. and i have been stored so many of my development documents are stored in that folder. i already geta backup for that., so its does n't matter. now i need www folder in var directory.
View 2 Replies
View Related
Mar 19, 2010
I am using putty(Windows XP) to connect to one of my remote ubuntu machine. I want to create a shared folder on that machine. Please help how to create a shared folder using terminal.
View 3 Replies
View Related
Jun 16, 2010
I have Administrator rights. I want to create new folder into /opt directory. So i clicked(Right click). but new folder menu has disabled. I cannot create new folder. Then Alternatively I used terminal. then I type mkdir /opt/lampp/htdocs/dummy now folder name has created. but I cannot paste anything into my dummy folder. So I checked permission which has you are not owner. How to create new folder & copy contents to new folder.
View 1 Replies
View Related
Feb 19, 2011
I am trying to mount the device sdb in the folder /mirror so I issue the command dmd@dolly:/$ sudo mount /dev/sdb mirror. I would now expect to see the contents of sdb in /mirror but instead of mounting in /mirror it is being mounted in /mirror/mirror and the second mirror folder is created during the mount
dmd@dolly:/mirror$ ls - returns no results
I then say dmd@dolly:/$ sudo mount /dev/sdb mirror and look for my mounted files in /mirror and I see this
dmd@dolly:/$ cd mirror
dmd@dolly:/mirror$ ls
lost+found mirror (an additional mirror folder)
mount says
/dev/sdb on /mirror type ext4 (rw)
I'm sure I'm just doing something goofy or otherwise have screwed things up but I've tried this several times with re-boots in the middle and wherever I choose to mount sdb it ends up being mounted one level lower in a folder of the same name.
View 9 Replies
View Related
Mar 20, 2011
I'm using two OS in parallel, and all of my data are stored in partition D. I want to create a shorcut to a specific folder inside it, e.x: D:/path/to/folder and put it in the Ubuntu Desktop (~/Desktop).
View 5 Replies
View Related
May 13, 2011
i'm workin on QEMU for ARM on ubuntu 11.4 and i needed to run this symbian-qemu-0.9.1-12-arm-none-symbianelf.sh script which is in this link [URL]
but i get this error ..
mkdir: cannot create directory `/scratch': Permission denied
is there any way to work around it and be able to create folders outside the root folder ??
View 9 Replies
View Related
Nov 29, 2010
Build Zip archive, special cases
I'm using zip to archive different files. I need to create a directory in the zip file where to place some of them. Is that possible ?
The syntax I got so far is zip output.zip -r /var/www/test
Inside the zip I want a folder called backup1 and in there the files from /test.
View 2 Replies
View Related
Jan 20, 2010
We have a storage server here running Windows. I have full permission to my share, blah blah, whole 9 yards. When I'm on Ubuntu and connect to it, I cannot create a folder or paste any items in "my" folder unless I put it in a sub folder.\storagejason = cannot create folders.\storagejasonstuff = can create folders.So, I come here asking the obvious question: dubya tee eff??
View 1 Replies
View Related
Jul 15, 2010
Im having this error when im trying to edit my root directories...
View 9 Replies
View Related
Oct 1, 2010
I have some USB drives that for some reason I cannot create folders or documents on. This pertains to all of my external USB drives. Works fine when I am in the Mac partition but not in Ubuntu. Another thing is that when I plug in an external drive, a nautilus window with the contents of the drive opens. Happens to all of my USB drives.
View 7 Replies
View Related
Nov 24, 2010
i'm confronting atm. I need to create a folder where ppl can copy files and i need to be sure that those files cannot be deleted after they are copied there. The folder will be accessed over network, and i need to be sure no one will delete somebody else's files.Also i need to tell you that i'm working with regular users, so creating a folder for each user and chown/chmod-ing it won't do the trick(allready tried and ended up with a whole lot of files in the parent directory).I also tried chattr +a but that doesn't allow them to write new files in the folder.
View 2 Replies
View Related
Jan 1, 2011
Like always Linux likes to make the easy tasks in life a little bit more difficult.
I have a NAS and Ubuntu 10.x I like to make a shortcut from a folder on the NAS drive to the desktop.
If i right click on the file and click 'Make Link' it tells me that the target does not support symbolic links.
So what can I do to make it happen?
is there maybe a way so mount the NAS like a fixed system disk? Because from the system disc I am able to make links.
View 7 Replies
View Related
Mar 17, 2011
I don't seem to be able to create a new folder in my system files. I know I have to do this in the terminal as root, but I always get the answer that it cannot create the directory because there is no such file or directory. Yet the directory where I want to make the new folder definitely exists (I even just go there and try to create the folder)Here is the exact code:Code:lukas@lukas-VGN-FZ21E:/proc/asound/card0/pcm0p$ sudo mkdir ossmkdir: cannot create directory `oss': No such file or directory
View 4 Replies
View Related