LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-02-2007, 05:27 PM   #16
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910

Quote:
Originally Posted by Amenemhet
Thanks Tink, yes I need all the users stuff, so, will this do? Or is it just an ls of their home?
Also, how can I prevent people from logging on temporarily? Is there a way to use the nologin command and give it a time variable for say , while the backup is actually running?
ie:
nologin
tar -cvf /var/local/backup/homedir-$(date +%a-%b-%d).tar /home
login
This doesnt seem correct, and the man pages for no login are sparse, is there another command I could use?
nologin isn't a command, it's just a file. If it
exists users won't be permitted to login.

Code:
echo "Sorry, undertaking some maintenance - try again later" >/etc/nologin
tar -cvf /var/local/backup/homedir-$(date +%a-%b-%d).tar /home
rm /etc/nologin


Cheers,
Tink
 
Old 03-02-2007, 05:55 PM   #17
Amenemhet
LQ Newbie
 
Registered: Mar 2007
Location: canada
Distribution: fedora core 5, ubuntu 6.1
Posts: 13

Rep: Reputation: 0
Lightbulb

Quote:
Originally Posted by Tinkster
nologin isn't a command, it's just a file. If it
exists users won't be permitted to login.

Code:
echo "Sorry, undertaking some maintenance - try again later" >/etc/nologin
tar -cvf /var/local/backup/homedir-$(date +%a-%b-%d).tar /home
rm /etc/nologin


Cheers,
Tink

LOL, man your clever
Just spent a few hours reading man pages and now my eyes are watering! I realize that nologin is a file in etc and should have figured out the route to take ... thats what I hate/love about linux....at first it seems so complicated, then when you figure it out it is usually the simplest. Thanks again
 
Old 03-03-2007, 09:50 PM   #18
pk2001
LQ Newbie
 
Registered: Feb 2007
Location: Singapore
Distribution: Debian Sarge/Etch
Posts: 19

Rep: Reputation: 0
Quote:
Originally Posted by gregorian
Yep, it worked. Brilliant. How did you get such an idea, genius? I'm very impressed.

Edit:

Alternate:
Well, as you so rightly indicated, no brilliant solution, but it works

Your one-liner "mv" seems very clean but the "-r" switch (which I presume recurses) is not a valid one in my Sarge
 
Old 03-03-2007, 11:30 PM   #19
gregorian
Member
 
Registered: Apr 2006
Posts: 509

Rep: Reputation: 34
Quote:
mv -rf A/* B/
You're right, in the above command, the 'r' switch stands for recursive. I find it strange that it didn't work for you, pk2001. I use the bash shell. I thought that the 'mv' command was the same for the *nix systems. But then again I'm new to Linux and have used only RH9.

Last edited by gregorian; 03-03-2007 at 11:31 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
useing SCP to copy entire directories with sub folders? Lleb_KCir Linux - General 5 09-13-2005 09:08 PM
xmms en que entire directories oily_rags Linux - Software 2 09-14-2004 01:50 PM
Move certain files into different directories facets Programming 6 05-28-2004 01:20 PM
partitioning a new drive, which directories can I move ? xucaen Linux - General 2 02-25-2004 09:03 PM
Can I move Untarred directories? Nigel_Tufnel Linux - General 5 08-08-2002 08:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration