Software :: Make Different Directories For Datatype
May 17, 2010
I'm trying to create a script that will:
1. Make different directories for a datatype.
2. Then create an HTML page for that specific datatype. So that users can access that data for that datatype.
1. This script will create directories for a specific datatype. Example rickk, rik, rikky etc.2. This script will aslo create subdirectories labeled by the duration of an event.For example if an event where to take place for 5 days, May 5 - 10th. Folders will be labled:20100505, 20100506, 20100507, etc will be included in each datatype.Since this exercise will take 6 days there will be 6 subdirectories under each datatype.3. This script will also create cgi scripts for each of the dataype and day of the the exercise.For example dataype "rik" for May 09 will read rik5.cgi, since May 09 is the 5th day of the exercise.This is how it looks so far, it works great but I realized that if and when I plan to add more datatypes that its going to involve alot of repetivie typing. I figure to simplify this whole thing would be best to use loops. Can someone direct me to some good information concerning loops and sample of loops? I have a feeling that what I need to do is going to involve a nest of loops.
#!/bin/ksh root_dir=/opt/global/webservices/apache/app/test/dynamic/ cd $root_dir
I need to create a startup file. As far as I've been able to find out the best locations to do this are the /etc/init and /etc/init.d directories. Two questions about that:
1) Can I just make blahblah.conf file in one of these directories and then it will be automatically read at boot-time or do I need to create a line that directs to the right file and location in again some other file?
2) Does it matter which of the directories (init of init.d) directories I use, ie., what's the difference?
I need to, through a bash script, go through a given directory (given as argument 1) to list out the relative path in this directory (including $1) for eact subdirectory which contains files. Directories which only contain . .. and eventually only subdirectories SHALL NOT be listed. It is this last requirement that makes it difficult for me.
I have been using the tree command for now, but I have not found a way to ignore paths to directories which only contains other subdirs or nothing at all in any easy way. I may offcourse test each directory after they are listed but this gives an extra loop to go through and I beleive it should be possible to do it directly when creatring the list. I guess by using find or ls in conjuntion with the tree command or by itself it should be possible but I am not to conversant of nested script commands.
When I try to view my home folder (for instance), I press the icon on the left of my name (/home/...) and it doesn't do what I accustomed to which is to show the text form of the directory. Is this a bug or am I missing something?
Here is the issue:I create saome variables to make shortcut to some directories I go frequently (so, I then I type, e.g. cd $P_DIR). Of Course before that I put a valid value into P_DIR variabe.Also, alias, asalias cls=clearSo, I type cls, and is the same as the commando clear (but shorter)What I want to do is that those variables as aliases stay in the computer when I reboot or turn off and turn on.So, I put "somewhere" (this is the place(s) maybe one for variables, and other for aliases, turn of the computer, and when I turn on, the aliases and variables are still there
I need to strip the executable flag from all files within a certain directory and sub directories. Right now I'm doing it with a 2 step process
find /dir/ -type f -exec chmod ugo-x {} ; find /dir/ -type d -exec chmod ugo+rx {} ;
Is it possible to modify the first line so that I can strip exec flag from all non-directory files? Since this needs to be done on a fairly regular basis across a lot of directories and files, I'd prefer not to use a bash script which would slow it down.
i am in need of linux help. iam at college and i need this back/restore script to pass this final part of an assessment. i require a backup script that will not only backup but also restore files to the relevent directories. e.g. users are instructed to store all wordprocessor files in a directory named wp. so i am needing to create a backup directory and 3 directories within that and some files within the 3 directories and then back them up ot restore them. l know i should/have to do this myself by been trying to get/understand info for the last few days and came up with zero.
I want to make a webserver with multiple users allowed to login through SFTP to a specific folder, www.Multiple users are added, lets say user1 and user2, and all of them belonging to the www-data group. The www directory has an owner www-data and a group www-data.
I have used chmod -R 775 on the www folder, but after I try to create a folder test through my SFTP server (using Filezilla) the group of the directory created has only r and x permissions, and I am not able to log in with the second user user2 and create a directory within www/test due to a lack of w permission to the group.
I also tried using chmod 2775 on www directory, but without luck. Can somebody explain to me, how can I make it so that a newly created directory inherits the root directory group permissions?
I am writing a script, in that my requirement is, if all the fill types stored in one directory from that we need to separate different different directories based on the file types.
for example in a directory(anish). 5 different types files 1- directory 2- .txt files 2- .sh files
like that and my requirement is the (1- directory is moved to one new directory(dir) which we are given in the script)and (2 .txt files are moved to another new directory(test) which we are given in the script)and ( 2 .sh files are moved to another new directory(bash) which we are given in the scrip)finally the directory anish should be empty..using bash script.how it is possible !!
Is it possible to restrict users to their home directories and allow admins to have different home directories? Essentially I want users to have a folder in /var/www/html/$USER and admins to have either unrestricted access or have their root directory be ./ or /www or /etc. I have is set now so users have access to thier home direcotry but I need to upload web files as admin.
I notice that when you try to Make link to any file or folder form context menu, It just copy the same file size? even when i tried to copy the link to external storage disk..
I need to modify fs/open.c and fs/read_write.c to make my modifications. I cannot find any options in 'make menuconfig' to make these files modules rather than compiled elements. I'm thinking these cannot be modules because the file system won't work without open.c and read_write.c. Is this correct - I cannot compile fs/open.c and fs/read_write.c as modules, only as compiled elements? Or, is there some way for a module to overwrite these routines when the module is installed and re-enable the routines when the module is removed?
I want to gave much details as possible. working directory (~/a1/shell) in the shell directory i have Makefile. also in the shell directory i have subdirectory's (obj, src, include)
My current Makefile
Quote:
#What needs to be built to make all files and dependencies
clean:
# End of Makefile
I wanted it so: all .o files are created in the obj subdirectory, and my application, sshell, is created in the shell directory.
I am getting this error when i run the make run: No rule to make target 'shell.h', needed by 'shutil.o'. stop
These kernel sources are usually the sources from debian, with a couple of more patches that I add. It appears that for nvidia-driver package versions higher than 352.79-1, the kernel headers/sources need to be prepared with 'make prepare' and 'make prepare scripts'. It's that simple. I concluded this after the nvidia dkms build failed on my custom kernel, but then succeeded after I pointed it to the full sources, but only after running 'make prepare' and 'make prepare scripts' on them. The problem is that this make-kpkg scheme doesn't appear to do this, or if it does, it doesn't properly include in the headers everything that it should.
I am following the instructions on Section 8.1.* Device Driver ConceptsHere I was able to proceed till section 8.1.4.After making the hello.c file,the make file and patching the Kconfig as mentioned,I tried to run the $ make ARCH=ARM CROSS_COMPILE=xscale_be- gconfig This gave error as:make: *** No rule to make target `gconfig'. Stop.I am not sure if my kernel is correctly compliled,but I was able to complie and build the kernel for arm before by cloning the kernel and building from the following link without any error. https://omapzoom.org/gf/project/omap...ux+OMAP+Kernel
I just installed Gnome Shell in Ubuntu 11.04 through UGR Linux and everything works fine! The only problem is that I cannot run make and make install. I get the following errors:
Code: alexandros@Autobot:~/gnome-shell/source/gnome-shell-extensions$ make && make install Making all in extensions make[1]: Entering directory `/home/alexandros/gnome-shell/source/gnome-shell-extensions/extensions'[code]........
I think I've learned that these directories are 'predefined' and eventually recreated at each login (even when deleted they appear again and over again, pretty annoying indeed...)
[URL] .... [URL] ....
Now I would like to avoid the default creation of those dirs but I did not understand how to edit the local and global configuration files controlling this behaviour (I think)
Code: Select allgedit ~/.config/user-dirs.dirs
# This file is written by xdg-user-dirs-update # If you want to change or add directories, just edit the line you're # interested in. All local changes will be retained on the next run # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an # absolute path. No other format is supported.
I have openSUSE 11.3. I logged in as root in the konsole and I can't change the directories in the home folder, for example I write "cd /home/java" and I get "No such file or directory" (and the directory exists).Also I can't copy or paste anything in the folders in "Root" from the GUI.
is there any way to ignore whole directories in Ubuntu-One? I figured out that you can use /etc/ xdg/ ubuntuone/syncdaemon.conf to ignore files by adding a regex to ignore.default, but I assume this only applies to files. So, how can I avoid the syncing of some subdirectories of my synced folders? I guess I could use symlinks as a workaround, because I read somewhere that Ubuntu-One wouldn't follow them.
How do I delete just directories and not files when performing a "rm -r foo*" command? E.G. I have foobar.txt foofoo.o foorebar.jpg and foo/ foonuggets/ and footemp/ in a directory. In one fell swoop how do I delete just the directories and preserve the files?
Seeing as how I only use the -r switch when removing directories I accidentally ran this command and removed files that I wanted (luckily nothing vital). Lesson learned now I want to prevent ever doing that on files that *are* vital.
I back up using a small rsync script. I've tried other methods but just keep coming back to it.
I have enough space that I can back up the entire root file system, but for speed and economy there are certain folders I'm not backing up. I understand some are dynamically generated on boot, others are caches.
Anything else I should exclude? How about APT's cache? /var? Any other caches?
I'm trying to create backup/archive my Ubuntu 10.04 system files (so I can restore it in case my system get corrupted). More specifically, I'm trying to zip the important files in my root directory not including my home directory (which includes my documents which I backup separately/more frequently) to an external hard drive attached via USB (called 'My Book').Since File Roller didn't give me quite the level of control I was looking for, I created a script that I could execute to backup and archive regularly.