LinuxQuestions.org
Review your favorite Linux distribution.
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 12-26-2011, 05:45 AM   #1
iceqube
LQ Newbie
 
Registered: Dec 2011
Posts: 1

Rep: Reputation: Disabled
System maintenance 2 questions


Since a few weeks I am playing with debian and now I have 2 questions.

The first one:

I want to create weekly a file to all user directories.
I know that you have a cronjob to schedule it weekly. In this cronjob I have written the following line:

df >> /home/%users/diskspace.txt

I've tried this first in the shell, but it won't put the outcome to all other home directories. How can I realize that this file is created in each home directory?


Second question is, how can I give all users of member group such as "family" a nice welcomes message?


Thanks.
Icy
 
Old 12-26-2011, 02:11 PM   #2
ochienged
Member
 
Registered: Oct 2007
Location: Plano, TX
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 70

Rep: Reputation: 26
Hello, I'll begin with your second question. To have a message to all system users by editing /etc/motd. If you are specific that the message must only be sent to members of the family group,you may be have to write your own script that would run when each user logs in and would check if they are a member of the group family before executing to completion.

Ill, give you some heads up on getting the groups to which a user belongs
Quote:
groups $USER | awk -F: '{ print $2 }'
On to your first question, the script should be run from an account with privileges to access(read and write) all other users home directories. Like, root. And this script should be started from root's home directory. A script created in a particular users domain can only run in that users domain.
 
  


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
Maintenance realted Questions (optimizing your Linux Load) NuxIT Linux - Newbie 5 05-25-2007 10:21 PM
System maintenance FictionPimp Linux - Newbie 2 02-01-2005 03:04 PM
and some Linux maintenance questions... grapier Linux - Newbie 4 01-12-2004 02:23 PM
System maintenance tied2 Linux - General 1 07-03-2002 12:01 AM
system maintenance vicente Linux - Newbie 2 08-31-2001 05:34 PM


All times are GMT -5. The time now is 05:06 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