General :: Can Root Create Directory When Not Exists While Backups

Nov 8, 2010

I am getting the databases from mysql and my database name is username_something.
I am getting the username and then puting the respective backups in corresponding folders like

tar bala bla /backups/sql/username/username_something.tar.sql.gz

The problem is system worrks if i have the folder username already there but for new databases if get the error like unknown file path.

How can i do that if username folder is not there it should be created

View 2 Replies


ADVERTISEMENT

General :: Does First Line Create File In Tmp Directory With Dsuser.exists

Oct 19, 2010

does first line create file in tmp directory with dsuser.exists.* ?or we are assigning the path of existing file in this directory?

View 2 Replies View Related

Ubuntu :: Checking If File In /root Directory Exists?

Jun 6, 2010

I want to create a file in the /root directory and then make sure it exists. The following code keeps telling me that the file doesn't exist even though it does.

Code:
#!/bin/bash
echo -e "username=someusername
passwordsomepassword" | sudo tee /root/.credentials
if [ -e /root/.credentials ]; then
echo "File exists!"

[Code]...

[Edit] Added second double quotation mark at the end of "somepassword"

View 5 Replies View Related

Fedora :: Script To Automate Backups - Storing Copy In Root Directory

Feb 4, 2010

Making a script. This is for my linux class. Basically when you run it, whatever directory it is in, zips everything, backs it up to the folder its in, and also makes a copy of it in the root directory. Here is what I have, but its not running right.

Code:
#!/bin/bash
echo
echo
echo "Automate Backups"
echo -n "Would you like to backup? Y or N:"
read answer1
if [$answer1 = "y"]
then
if [$USER = "root"]
then
echo
tar -cPvzf "$USER"_backup.tar.gz.`date +%F` /"$USER"/*
cp "$USER"_backup.tar.gz.`date +%F` /backups/"$USER"_backup.tar.gz.`date +%F`
echo "Successful Backup"
fi
echo
tar -cPvzf "$USER"_backup.tar.gz.`date +%F` ~/"$USER"/*
cp "root"_backup.tar.gz.`date +%F` /backups/"$root"_backup.tar.gz.`date +%F`
echo "Successful Backup"

View 14 Replies View Related

General :: Create Backups From Some Copy Protected DVD's?

Apr 14, 2010

I'd like to create backups from some copy protected DVD's, for my private use only.

Does it work this way to circumvent the copy protection mechanisms?

Code:
# dd if=/dev/dvd of=dvd.iso

and then burn dvd.iso on an empty DVD.

View 3 Replies View Related

General :: Excluding Executables In A Sub-directory From Tar Backups?

Jul 29, 2010

Just trying to set up a new backup using tar, but there are a few things I dont want to include. Using --exclude I can exclude sub-directories, but how do I exclude specific files in a subdirectory that are (for instance) executables or have a specific extension?

View 5 Replies View Related

General :: Check If A Directory Exists In Command Line?

Jan 21, 2010

How to check if a directory exists in Linux command line?

[Code]....

View 5 Replies View Related

General :: Add User With Specific Home Directory That Already Exists

Apr 9, 2010

Im trying to add users to my nfs server with a specific home directory that already exists. Can this be done? I've done some research on google and other forums but cant seem to find the answer.

View 7 Replies View Related

General :: Bash Script For Doing Tape Backups - Need Root Password

Feb 14, 2011

I have a bash script that I am using for doing tape backups. The meat of the bash script is
sudo tar --totals -H pax -cvf /dev/st0 *
This all works just fine.

But of course tape functions have to be ran as root, therefore sudo, requiring the standard user to enter the root password. I would like to be in a situation where the standard user does not need (does not know) the root password. I think my solution is add that standard user.
User named dog to the sudo list.

I have reviewed the sudo man page and looked at [URL]. I am still fuzzy.
1- Will adding user 'dog' to this sudo list do what I expect meaning I can run:
sudo tar --totals -H pax -cvf /dev/st0 *
and the user is not queried for the root password
2- How do I do that? and do I make a cmd alais for only: "tar --totals -H pax -cvf /dev/st0 *"
My distro is OpenSuse.

View 17 Replies View Related

Ubuntu :: Directory Exists But Bash Says It Doesn't - No Such File Or Directory

Aug 19, 2011

I've run into a problem with my bash program.

Code:a mkdir -p /home/chris/Downloads/ARCHIVE/`date -I` find /home/chris/Downloads* -mtime +14 -exec "cp {} /home/chris/Downloads/ARCHIVE/`date -I` ;

It's meant to move old files from my Downloads folder into an archive file (later tar them). The directory exists, I've used $PWD and nautilus and ls to make sure it's there, yet for every file it gives

Code: find: `cp /home/chris/Download/foo.bar /home/chris/Downloads/ARCHIVE/2011-08-19': No such file or directory I tried to test it on a different destination, specifically my home folder. IT still gave me the error.IS it a bad syntax within find or something else? I'm running a 32-bit system with 11.04

View 4 Replies View Related

Networking :: How To Create SSH User Without Access To Root Directory

Aug 7, 2009

I need to create an SSH user that can only access the directory I would specify for them. For example, I've been able to execute the following:
useradd -d /home/me/directory_for_this_user someuser

So when someuser logs in they get into this directory. Problem is that once they log in they can simply execute:
cd /
and navigate through all other directories which is a security risk.

How I could limit someuser's access to only /home/me/directory_for_this_user and its subdirectories and nowhere else in the system?

View 1 Replies View Related

General :: Rsync Incremental Backups Rather Than Full Backups?

Nov 12, 2009

How do you get Rsync to do incremental backups rather than full backups? At the moment I have a script that will create a backup folder (if it doesnt already exist) then copy the source files into the backup directory with the command

rsync $VERBOSE --exclude=$TARGET/ $EXCLUDE --exclude '/Ls-wtgl1c8/**' -rt --delete $source/ $TARGET/$source/ >> $LOG_FILE

Target is where the files will be backed up to Sources is the dir(s) to be backed up Exclude files is the list of files not to backup
log file is where the output will be saved to. At the moment it only does full backups, but I would only like to do incremental, how would this be achieved? Am I missing out an option in the Rsync that is required.

View 9 Replies View Related

General :: Use Mkdir Command To Create 'local' Directory In /usr - There Are Error - Cannot Make Directory

Jun 16, 2010

I am a student studying computer science course.

Well, I am facing problem when doing lab questions.

I must use DLXLinux bundled in Bochs (bochs.sourceforge.net).

I am required to use the /usr/local directory.

In /usr directory, there is no directory named 'local' but there is one thing called 'local@'. So, when I try to use mkdir command to create 'local' directory in /usr , there are error "cannot make directory.....".

Look at my screenshot at [url].

View 9 Replies View Related

General :: Create A Directory Named Like His Parent Directory

May 26, 2011

I need to create a directory named just like his parent.

Example:

I tried this but because there is "Space Characters" in the name of Parent directory, my script fails.

View 8 Replies View Related

Ubuntu :: Create Loss Less Backups Of DVDs?

May 30, 2010

I would like to create lossless backups of my DVDs, or more exactly the main movie including one or more audio tracks and a subtitle of my choice. I would like to have the subtitle burned into the movie so that I only have one file (container). No, I don't want a complete DVD folder (TS_Video and other stuff) nor do I want to create an iso file of the DVD. Is it possible? The way I see it there should be two options:

1. Extract the wanted audio track/tracks, one subtitle and the main movie. Keep the audio track/tracks and the movie track in their original formats, and put it all together in one file/container (subtitle burnt in). In theory it should work! I know the video tracks are mostly MPEG2 and the audio tracks mostly AC-3 or DTS.

2. Do almost exactly as above, but before putting it all together compress the video and audio tracks even further to some lossless formats. In theory this should work too! In some other forum a guy told me that since MPEG2 and AC-3/DTS are already compressed formats it probably isn't possible to compress audio and video much further without losses, which is probably true.

Is it possible to do what I want to do? How? If this process is not easy to do it would be nice if some of the skilled guys would create an application that does exactly this. I believe more than me would find it extremely useful.

View 6 Replies View Related

General :: Installing As Non-root In A Root Owned Directory

Mar 8, 2011

I have a machine which has only /opt with some decent amount of space where I can install a software. /opt belongs to root:root. The software I want to install cannot be installed as root user.

So lets say I create a directory called /opt/install1 and then chown -R install1 to belong to user1. And now I install the software under /opt/install1 with user as user1.

Is this a best practice violation? There could potentially be just /opt/install1 belong to user1 and in future everything else created under /opt belonging to root..

View 2 Replies View Related

Security :: Logging In As Root Over Rsync/ssh For Backups?

Sep 30, 2010

I need to login as root, or at least get root privileges, in a cron triggered backup run. The straight way to do this would be the backup server making an ssh connection to the server to be backed up (this way because I want to avoid many servers being backed up in parallel and the backup server itself would be managing this diversity), via the rsync command which would be performing the backup's synchronization step.

I'm looking for alternatives to this in some form. I'd like to disallow direct root login to my ssh port (not 22One idea I have is to have the backup server initiate an ssh login as a non-root user, to either the actual source server, or to a server that can reach the source server ... and set up port forwarding. Over the forwarded port, then initiate the rsync that logs in as root via another port that allows direct root, but cannot be reached from the internet at all (because the border firewall doesn't include this port as allowed in).FYI, these logins will be using ssh keys, not passwords. I do need to keep ownership metadata for files being backed up, so this is why I am using root. Also, rsync is needed to get the incremental updates to keep bandwidth usage lower (otherwise I could just transfer a tarball each day).Anyone have any other ideas or comments, for security issues, based on experience doing things like this (backups, routine data replication, etc)?

View 5 Replies View Related

Ubuntu :: Can Create An Automatic Sequence Of Spreadsheet Backups

Jan 7, 2011

I would like to create an automatic sequence of Openoffice backups of a spreadsheet file, and each would be the daughter of the previous version.I would like it to autosave every hour so at the end of the day I could then manually make up a 'Day' file for permanent record.

View 2 Replies View Related

Server :: Create Daily Incremental Backups Easily?

Nov 29, 2010

I've had several HDD crashes on my personal server over the years and it's just gotten to be a real pain in the rear. Crashed again this morning. Currently, I make monthly tarball backups of the entire filesystem using my script:

Code:

#!/bin/sh
# Removes the tarball from the previous execution.
rm -rf /backup/data/*.tar.gz

[code].....

View 13 Replies View Related

Ubuntu :: Checking To See If A Directory Exists Remotely?

Jan 14, 2010

I'm working on my first bash script. My script will do several things but right now I'm just trying to get the basic part of it down and working.I have a section that looks like this

Quote:

#/!bin/bash
SERVER=$1
if [ ! -d `ssh ${1} /somedir`];then
echo "Bad"

[code]...

The problem is that if you take that right now and run it, it will return back good in that it does exist. What I need it to do is pass back that it's bad because it doesn't exist (that is unless you actually do have that directory in your root).

View 1 Replies View Related

Programming :: Check If There Is Any Ejb File Exists In The Directory

May 1, 2011

I have a directory called /data In this directory I have some files like abcejb.jar,12_ab_ejb.jar, shejb.jar, test I need a shell script like... 1st I want to check if there is any ejb file exists in the directory using some condition If ejb files exists I want to redirect the ejb files list to a file called list. Now I want to copy all the files in the list file to some remote system.

View 1 Replies View Related

Fedora Servers :: Cannot Delete Directory 'foo': File Exists

Jan 17, 2009

I was transferring some files from my laptop (running FC6) to a server at my work (don't know what kind) with "scp -rpC" and it stalled, don't know why.
Now when I try to delete the files from the server so I can start again I get the following error message

Code:
rm -r Single_injections/
rm: cannot remove directory `Single_injections/195320/400mA/010': File exists
rm: cannot remove directory `Single_injections/195320/400mA': File exists
rm: cannot remove directory `Single_injections/195320': File exists
rm: cannot remove directory `Single_injections': File exists

[Code].....

View 6 Replies View Related

Programming :: Check If Directory Exists Using Shell Script

Apr 20, 2009

I am trying to write some small script file that will check if a USB stick is connected to my pc or not. I can't seem to get it to work, but I am sure it is a very simple fix.

I am running on Fedora core 10.Can anyone help me figure out what the problem is?If I run these lines through console it works fine (meaning, I type the commands in this file straight in the command line/console).

View 9 Replies View Related

Ubuntu / Apple :: Failed To Create File '/root/.local/share/recently-used.xbel.AC7YXV': No Such File Or Directory

Jun 22, 2011

I have iMac 2.4GHz with rEFIT installed. I installed Unity on one of the partition. Kernel is still 2.6.38.8. I am getting error message when I run the command
sudo gedit /etc/x11/xorg.conf

The error message is

(gedit:2139): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.AC7YXV': No such file or directory

(gedit:2139): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory

View 3 Replies View Related

OpenSUSE :: 11.2 Updates And Kdesu Command - Directory OpenSUSE_11.2 Doesn't Exists

May 23, 2011

Not sure but has support and updates for 11.2 come to an end? Every monday morning i make sure i'm upto date with updates etc. This am i get a message saying "repo not available" and having looked online to see if the directory openSUSE_11.2 exists, it doesn't.

At the same time loged in as a std user i regularily offer the command kdesu kwite. the command is accepted without error and the cursur returns on a new line as expected but kwrite doesn't start. I'm guessing that my last update has left me with a broken OS. It doesn't seem very long at all since i installed 11.2!

View 9 Replies View Related

Programming :: Shell Script To Check Whether Directory Exists On Remote Server

Jan 17, 2011

I am new to scripting, would like to have a script that tests whether a directory exists on remote host & display the message accordingly. The remote hostname can be provided by means of file containing list of hostnames. Can use rsh for connecting to remote host.I tried with couple of scripts by searching google but didn't get desired result. Please help me, below is my efforts, $file contains list of hostnames.

View 10 Replies View Related

Ubuntu Networking :: Create File Sharing Between MacBook Pro And Lucid Box For Time Machine Backups?

Mar 19, 2011

I've been trying to create file sharing between my MacBook Pro and my Lucid Lynx box for time machine backups and media server purposes. I followed this guide:[URL]..Everything seems to work with these exceptions: I can see my LucidLynx box in my finder app in my Mac but only when I run these commands from Ubuntu:

Code:
sudo /etc/init.d/netatalk restart
sudo restart avahi-daemon

If I restart my LucidLynx box then I can't see anything in finder. I can't log into my LucidLynx box from finder. I don't get a bad username or password error it just tells me the connection failed. *Note if I do enter an incorrect username or password it WILL tell me it's incorrect. I've looked at this link below since some people have used it in theses forums but it's a bit dated[URL]..

View 2 Replies View Related

CentOS 5 :: Scheduled Unattended Backups With Alerts If The Backups Fail

Feb 3, 2011

I've been a DOS/Windows guy for 20 years, and recently became a SW test lab helper. My company uses CentOS for a lot, so I've become familiar with it, but obviously not as comfortable as I am with Windows.

Here's what I have planned:

machine: Core 2 Duo E8400, 8GB DDR2, 60GB SSD OS drive, ATI 4650 video card, other storage is flexible (I have 3 1TB drives and 4 750GB drives around that can be used in this machine.)

uses: HTPC, Network Storage, VMWare server host: SMTP, FTP server, and Web server virtual machines

I've figured out how to do much of this, but I haven't figured out how to do backups in Linux. I've been spoiled with Windows, with the built in backup system so simple to use. I find myself overwhelmed with the array of backup software, and unable to determine which to use. none of them seem to do everything I need them to do, but some come close, I think. I'm hoping someone here can help me out in figuring out which program to use and how to use it.

Here is what I need the backup software to do:
1. scheduled unattended backups, with alerts if the backups fail
2. a weekly full backup with incremental every 12 hours
3. removing the old backups when the new full backup runs, I would prefer to keep 2 weeks of backups, but that's not necessary
4. a GUI would be preferable, since my arthritic fingers don't always do as I want them to do. I typo things a lot, and the label worn off my backspace can attest to that.

View 7 Replies View Related

General :: How To Create Shared Directory

Jan 28, 2010

iam new to linux. wanted to know-->how to create a shared directory in lunix which should be accessible from windows

View 4 Replies View Related

General :: AMP Directory Not Found / Need To Create?

May 2, 2010

In Elastix, I get to amportal.conf via the /etc/ director. The file tells you:

[Code]...

It appears that AMPADMINLOGO=logo.png is calling out to something that is not there. I can't even find AMP directory. See below. Do I need to create a directory? This is the result of an ls -F at my /etc/ dir:

[Code]...

View 1 Replies View Related







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