Programming :: Shell Script That Deletes All Files Owned By A User?

Jan 14, 2010

the script should take as input in the begginig the username of the user and then deletes all the files and folders from the user in every place he has them. script must also check if the parameters have been given correctly (only one and that one must be a username) Doesnt all the files of a user exist on a folder with his name? what if i delete this folder? Will something like this work?

Quote:

E_NOARGS=65
if [ -z "$1" ] # Exit if no argument given.
then
echo "Usage: `basename $0` directory-to-copy-to"

[code].....

View 7 Replies


ADVERTISEMENT

Ubuntu :: Desktop User Deletes Www-data Files?

Dec 26, 2010

I have some developers with Desktop User accounts. How can I allow them to delete files owned by www-data which are created under their accounts (/home/username/public_html) by PHP scripts they are coding and testing.I tried to edit www-data user group and add the user as a member of it but this has no effect - the user still unable to delete these files only by creating another PHP script!

View 1 Replies View Related

Ubuntu Installation :: Files Owned By User 1000 - No Access

May 25, 2010

Running 9.10 now, I'd like to do a clean install of 10.04 on my dual-boot (with XP) Compaq notebook. As a test, I burned an ISO image onto a 1-GB stick and booted to 10.04 from it. It works just fine, except that the directories in the Documents folder on my hard drive are owned by "user 1000", and "he" grants me access to only about half of them.

Is this problem likely to persist if I actually install 10.04 rather than just running it from the stick? If so, what can I do about it? Second question: am I correct in understanding that if I still need to access my Ubuntu partition from XP, I'd better stick with ext3 for this install rather than going to ext4?

View 2 Replies View Related

Ubuntu Servers :: Jailkit Msg: Directory Not Owned By User But Directory IS Owned By User

Apr 9, 2011

I'm trying to jail a sftp user. All I want is for my daughter-in-law to be able to download pictures of my grandson on his step-uncle's motorcycle. But I don't want her browsing around. She's not a techie, but she's smart enough to catch on how WinSCP is looking at my files. I've set up the jail using jk_init, adding ssh, sftp, bash, netutils, basicshell, jk_lsh.

The physical root of the jail is owned by root, as are all the binaries loaded by the jk_init. The user's home directory is owned recursively by the user and is writable only by the owner. The passwd and group files are in the jailed /etc and populated by the user's lines. Shell is bash, and bash is there too. The error message must be coming from some other problem that's not notifying, but what?

View 4 Replies View Related

Programming :: Find All The Files Not Owned By Root:root On The Commandline

Sep 9, 2010

I need a way to find all the files not owned by root:root on the commandline. How can this be done?

View 2 Replies View Related

Programming :: Shell Programming - Delete User Input

Jan 21, 2011

I recently started shell programming and my task now is to do a menu display.Currently i am stuck whereby user will input both title and author and it will delete it.

Do i have to use sed command?

View 4 Replies View Related

Ubuntu :: Creating Directories Owned By Specified User

Jul 15, 2010

I have just installed an SSD as a secondary hard drive and formatted as ext4. (the Ubuntu installation is on a different drive)how I would go about creating a directory on the SSD that is owned by the user 'Test user'.

View 8 Replies View Related

Programming :: Shell Scripting: How To Create A User

Sep 5, 2010

How do I create a user account in a shell script? I know this may sound n00bish to you, but I know it's more than just mkdir-ing the home directory and subdirectories.

View 7 Replies View Related

General :: Can't Copy Files To Root Owned Files?

Feb 1, 2011

When i installed ubuntu. I made a seperate partition so that i could copy an ISO image onto it of an up-to-date version of ubuntu. I wanted to then boot the ISO up so i could install the version that way.I've already tried doing it through the update manager but it'll download, almost be done with installing and it freezes on me. so i figured this would be easier. However i do not know how to gain access to the other partition to copy the ISO image.

View 6 Replies View Related

General :: Setuid Process Cannot See Processes Owned By That User

Nov 2, 2010

I would like to give a non-root user (nicollet) the ability to detect and send a signal to processes started by Apache2 (those processes are FastCGI scripts and the signal tells them to empty their cache). The processes are owned by the web user (www-data), and I'm running on Debian unstable.

I can't find any way to have the nicollet user see those processes.

The processes are running and can see by both root and www-data:

root@linux-01:~# ps -Af | grep baryton
www-data 17649 17648 0 10:27 ? 00:00:00 baryton
www-data 28145 1 0 Nov01 ? 00:00:12 baryton --bot
root 18701 18700 0 10:46 pts/0 00:00:00 grep baryton
root@linux-01:~#

[Code]....

The most surprising is that the grep process is indeed run by www-data (because it's started from a setuid executable) and is visible, but the baryton process isn't.

What's going on here? Why can ps run by www-data show those processes, but ps run by a setuid executable running as www-data cannot, when it's started by nicollet?

View 1 Replies View Related

General :: Execute A Command On X-session Owned By Another User?

Jul 13, 2011

Is possible (by root of course) to run a command from console, that will be executed on X-session owned by another user on the same linux box/machine ? Example: Can root open xclock for another local user logged into X11 ?

View 2 Replies View Related

Ubuntu :: Setting Up Shares For Non-user Owned Folders?

Mar 11, 2010

I've setup a Moodle server on 9.10 server, and have been able to share user folders back to the windoze machines on the home net. What I'd like to do is share the Moodle main folder (and descendents) likewise. The problem is that it's owned by root. For ther user folders, as long as the owning user was logged in they were able to mark the folder as shared and everything worked very smoothly. When I try to mark the moodle folder as shared, no suprise I get a permission error. Is there a way of doing a "sudo su" from the GUI desktop to allow this to happen? Or do I have to set up the share from a command line (after having done a sudo su)? Can anyone give me the magic commands needed to do such?

View 1 Replies View Related

Ubuntu Installation :: Creating Directories Owned By A Specified User On SSD?

Jul 15, 2010

I have just installed an SSD as a secondary hard drive and formatted as ext4. (the Ubuntu installation is on a different drive) Im very new to linux, Could someone inform me how I would go about creating a directory on the SSD that is owned by the user 'Test user'

Im sorry if this is a daft question, im just moving from windows to linux and struggling a lot.

View 3 Replies View Related

Programming :: String Deletes Its Own Value In C?

May 4, 2011

I have a school project to write a horse racing program, where the user can type their name, bet money, etc. However, after storing the user's name, it will delete itself after a few more instructions. So when I try to read back the user's name, it it blank. just this one section:

Code:

printw("Welcome. Name?
");
refresh();
scanw("%s",name1); //ask for name

[code]....

View 14 Replies View Related

Programming :: Use Firefox As User-interface For Shell Script?

Mar 29, 2010

In Windows, I was able to use IE as a user interface because I could code a WSF (Windows equivalent to shell script) to respond to events in IE.Now that I've moved to Linux/Firefox, I'd like to use Firefox in a similar way. Specifically, I would like to write a bash script to run lsdvd with XML output, use XSL to transform the XML for Firefox, then take an action (encode a selected track on the DVD) based on the user's selection. I would be happy if I could make Firefox write something somewhere that the script could read, but I suspect that security measures would prevent that.

View 3 Replies View Related

Ubuntu :: Editing Root Owned Folders With A User Program?

Apr 10, 2011

I'm using the IDE Netbeans (text editor) on my /home/michael Ubuntu account. I'm trying to open a file with Netbeans that's owned by root, I can't do this as I expected. So is there a way to run NetBeans as root, or is there a way to give netbeans permission to open/save files owned by root

View 1 Replies View Related

Programming :: Take A Single Line Of Input From User In Shell Script?

Mar 10, 2011

How do i take a single line of input from the user in a shell script?

View 3 Replies View Related

Ubuntu :: Nautilus Deletes Files Without Warning / Fix It?

Nov 14, 2010

I've noticed since upgrading to Maverick that nautilus has become very buggy and crashes quite a bit (I've noticed it tends to happen during multiple file transfers but really it happens often and not only because of transfers).

While I've been able to tolerate this crashiness, today I came across a problem that is very distressing. If I have two files in a folder and I rename one so that it has the same filename as the other, nautilus does not display an error message. Instead what seems to happen is that it retains one file and deletes the other permanently (There seems to be nothing in the trash as far as I can tell).

Has anyone come across this error before? If you have, I'd really appreciate any advice on how to fix it.

View 4 Replies View Related

Ubuntu :: Rsync Deletes Files It Should Not Delete

May 4, 2011

I built a script that downloads my podcasts using Gpodder into the directory /HOME/SHARED/PODCASTS/ (with a subdirectory for each podcast)The script then selects the latest episode and copies it over to a target directory (it empies the target directory first and copies over everything) I want to use RSYNC to make sure the 'not so fresh' episodes get deleted and the "fresh" episodes get copied over. Then dropbox can sync the "new" files over to the cloud where i can access them via my ipad/iphone (whole other story).The thing is : i've replaced the cp command with the RSYNC command and now the script is acting strangely.

It selects and sync's over the "newest" podcasts to the destination directory. Then it suddenly DELETES all the episodes in the destination directory and copies over the three last files.

View 8 Replies View Related

Slackware :: 12.2 Deletes All /dev/fd?u* Floppy Special Files On Boot?

Nov 15, 2009

Slackware 12.2 has the unkind habit of deleting all the /dev/fd?u* floppy special files upon boot-up. I have to make another directory (I use /floppy) to contain these files so I don't have to keep copying them from an earlier distribution (12.1) Now, for example, to format a 1743 kilobyte floppy, I do fdformat /floppy/fd0u1743 mformat a:If I copy these special files to /dev (where they belong) then some part of Slackware Linux 12.2 deletes the special files when I power down and power up the machine.Slackware 12.1 and earlier leave floppy special files severely alone upon shutdown/startup.I cannot seem to "grep" a reference to /dev/fd anywhere in /etc/rc.d or its subdirectories. Why is Slackware 12.2 deleting them?

View 1 Replies View Related

Programming :: C Scanf Arbitrarily Deletes Contents Of Another Variable?

Oct 3, 2009

I am in the process of writing a program that plays the game mancala. I wanted to create a function that requires the player to choose a number between one and six, should be simple right? I kept having problems, so I started testing stuff out.

Code:

#include <stdio.h>
#include <stdlib.h>
short move();

[code]....

I am using gcc version 4.3.2 (Debian 4.3.2-1.1). On a whim, I tried something else out; when I change the 'short' variables to 'int' , the problem seems to dissapear.... I tried changing the format string in the scanf statement from "%d" to "%u" which is listed as the appropriate string for the 'short' type, still no luck.

View 13 Replies View Related

Programming :: Bash Shell Read User Argument From Command Line And Test It

Aug 29, 2010

Trying to create a small script that will read user's input, test if user entered some input and if not display some message or display a text using user's input.

The script is the following but i get an error saying "[: 6: =: argument expected"

View 12 Replies View Related

Ubuntu :: Getting A List Of Files Not Owned By Any Package?

Feb 7, 2011

I'm pretty sure that I have some unneeded files laying around on my system. Most of them are created with "make install" command.

To remove them, I need to get list of files which are not owned by any package. How can I do that?

There is a way in Arch Linux: [URL]

View 3 Replies View Related

Red Hat / Fedora :: Recover Root Owned Usb Files?

Jul 7, 2011

I have a usb drive that is owned by root with chmod set to -w-r-x for all othersthe system that root existed on crashed and now i'm trying toecover the files on my usbi have the root password and uuid of crashed hdd can i use a program or copy uuid to new system to recover usb?

View 1 Replies View Related

General :: Remove Files In All Directories Owned?

Jan 8, 2010

Is there a way to do the rm command where I can remove files by owner. I run the standard ls -al command and I want to be able to remove the files that are owned by me in that current directory. One other step how can I remove files in all directories owned by me. I did the google search first guys and a majority of the pages just dealt with the basics like rm -r

View 5 Replies View Related

Programming :: Redirect Output To Files Using Shell?

May 21, 2011

I have a huge database of students, I would like extract these data and write to individual file for each students.

I am running a loop in shell program (.sh file), the output of each run in the loop need to redirected to a file with variable name.

I tried the following line, but it did not work, where BodyMsg is the data and Rollno is the students roll number.

echo $BodyMsg > $RolNo".html"

View 5 Replies View Related

Programming :: Updating XML Files Using A Shell Script?

Apr 1, 2011

I continue to work on automating the update and deployment of a vendors WAR files, and have bumped into my next challenge... The vendor provides web.xml files have entries that look like this

Code:

<context-param>
<param-name>siteminder.enabled</param-name>
<param-value>false</param-value>
</context-param>

I need to search the file for a param-name and replace the param-value below it with the correct value. I expect sed or awk is the trick on this, but I am not sure how to have it search for one line, and have it update the line below it.

View 3 Replies View Related

General :: Set A Directory So That All Files Created Below It Are Owned By Dir Owner?

Jun 8, 2011

I have a directory cookie_tmp which is owned by some:fella. Session cookies are being created under this directory as How can I set the directory so that files are created and owned by some:fella ?

View 2 Replies View Related

Programming :: Write Shell Script For Copy Files?

Mar 25, 2010

write shell script for copy files to usbdąsk that cosist of very long argument like "2009025_efkl".

View 1 Replies View Related

Programming :: Compare Two Files Using Perl Or Shell Scripting?

Mar 8, 2010

I want to compare the following two tab-delimited .txt files (both were subsets of the original files) by comparing Columns 3 and 4 simultaneously. It is easy to compare C3 because both C3s are just numbers. But how to compare C4s?Basically, in File1, "G,G" = G in File2, "C,C" = C in File2, "A,A" = A in File2, "T,T"= T in File2.In File2, A/T in Column4 just equals "A,T" or "T,A" in Column4 of File1. C/T in Column4 just equals "C,T" or "T,C" in Column4 of File1, and etc.

File1:

C1C2 C3C4
ih509rs12345467244750"G,G"
ih499rs6049687244911"C,C"
ih508- 7244977"A,A"

[code]....

View 2 Replies View Related







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