Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 12-26-2011, 05:45 AM   #1
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?

Old 12-26-2011, 02:11 PM   #2
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
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.


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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:40 AM.

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