Problems after filesystem housekeeping


 
Thread Tools Search this Thread
Operating Systems HP-UX Problems after filesystem housekeeping
# 1  
Old 03-31-2017
Problems after filesystem housekeeping

I have noticed that after I clear up the /var filesystem, there are always problems.

Does deleting the OLDsyslog.log file cause problems like missing directories and problems accessing crontabs?

There were two situations where I faced problems.
1) Deleted OLDsyslog.log (Of course I created an archive of this before deleting).
The next day there were problems of missing directories in a path not even related to the log which is /var/adm/syslog.

2) In this situation, I also did the same - deleted old syslog, and backdated ones, and now there is another problem, whereby users are not able to access their crontab :

Code:
$ crontab -l
crontab: you are not authorized to use cron.  Sorry.
bscs.L28bi02> (/bscsbin/lisa)

And so I checked the server, and found that even the cron directory went missing! So this means that everything under cron like cron.allow was gone. I had to manually create the directory and this file for the user to be able to use it again.

Now the user can list the crontab entries, but not able to save new cron entries :
Code:
/var/tmp/aaaa15475" 277 lines, 14951 characters cron may not be running - call your system administrator

I restarted cron, then I can save the entries.

Also, I realize now that many directories in /var/adm are missing. Like /var/adm/sa, /var/adm/syslog.
I cannot even get any output from the command "last". (To check who deleted the files). The error is :

Code:
# last
 : No such file or directory


Last edited by anaigini45; 03-31-2017 at 01:53 AM..
# 2  
Old 03-31-2017
  1. What shell are you using?
  2. Exactly what command did you use to remove OLDsyslog.log?
  3. Exactly what command did you use to remove the old syslog and the backdated log files?
# 3  
Old 03-31-2017
1)What shell are you using?

Code:
# cat /etc/shells
/sbin/false
/usr/bin/sh
/sbin/sh
/opt/mastersam/bin/msh
/opt/ssh/utils/sftponly
# echo $SHELL
/sbin/sh
#

2)Exactly what command did you use to remove OLDsyslog.log?

I first archive it to a different location, then in /var/adm/syslog :
Code:
# rm OLDsyslog.log

3)Exactly what command did you use to remove the old syslog and the backdated log files?

I first put all these files in one directory. After archiving this directory onto another place, I deleted it with the command :

Code:
# rm -rf <dirname>

# 4  
Old 03-31-2017
And what directory name argument did you use when you issued the command:
Code:
# rm -rf <dirname>

while running as root?
# 5  
Old 03-31-2017
Hi,

I created a directory named logarch in /var/adm/syslog :

Code:
# mkdir logarch

I then moved all the OLDsyslog files and other backdated log file into this directory :

Code:
# mv OLDsyslog logarch
# mv mail.logSAMTRM logarch

After archiving this directory to a different location, I then delete it in /var/adm/syslog :

Code:
# rm -rf logarch

And of course I do this in while I am in /var/adm/syslog.

---------- Post updated at 06:17 PM ---------- Previous update was at 04:03 PM ----------

And yes, I did the steps above as root user.

Last edited by anaigini45; 03-31-2017 at 05:12 AM..
# 6  
Old 03-31-2017
I knew that you were removing the files while running as root. But the symptoms you are describing are those of removing something other than a directory containing old files. It sounds a lot more like you are removing all of the files starting a layer or two higher in the directory hierarchy than the file hierarchy rooted in /var/adm/syslog/logarch.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

[Tip] Housekeeping Tasks Made Easy - User Home directories and Leftover Files

We have regularly questions about how to create users and user accounts. But regularly user accounts need to be deleted too. It is quite easy to delete the user account itself but usually the HOME directory of the user remains. It is good style to remove these directories but simply deleting... (3 Replies)
Discussion started by: bakunin
3 Replies

2. AIX

Housekeeping null 2>&1 in /dev

Hello, Does anyone know how to housekeeping the null 2>&1 file in /dev? its fill up my system, please help. Thanks :b: (3 Replies)
Discussion started by: only
3 Replies

3. Filesystems, Disks and Memory

Filesystem Problems with DMG

Hi all! I have a task that has been giving me problems.I have my sister-in-law's external hard drive that has been damaged and the filesystem is not mountable. I am on a Mac running OSX 10.6.8 Using ddrescue, I recovered the contents and transferred to my external drive: sudo ddrescue... (0 Replies)
Discussion started by: Imhotep1963
0 Replies

4. Shell Programming and Scripting

Housekeeping script

I have a directory ( eg. /tmp , there are many files in it , I would like to do the houskeeping job , can advise how to develop a script to do the following . 1) if the files are elder than 10 days in this directory , the extension is .txt , then move it to /tmp/tmp-txt , the same , if the files... (2 Replies)
Discussion started by: ust3
2 Replies

5. Shell Programming and Scripting

Housekeeping Not Working

Hi, I have a .ksh script which finds all the directories older than 84 days and tries to housekeep. Below is the command used find * -depth -type d -ctime +84 -exec rm -rf {} \; The above command lists all the directories ie child and parent directory in descending order which are more... (10 Replies)
Discussion started by: annamalai77
10 Replies

6. UNIX for Dummies Questions & Answers

hwo to find shared filesystem and local filesystem in AIX

Hi, I wanted to find out that in my database server which filesystems are shared storage and which filesystems are local. Like when I use df -k, it shows "filesystem" and "mounted on" but I want to know which one is shared and which one is local. Please tell me the commands which I can run... (2 Replies)
Discussion started by: kamranjalal
2 Replies

7. Shell Programming and Scripting

Filesystem Monitoring script problems

Hi there all, #!/usr/bin/ksh Set -x MIN_MB_FREE="100MB" # Min. MB of Free FS Space MAX_PERCENT="85%" # Max. FS percentage value FSTRIGGER="1000MB" # Trigger to switch from % Used to MB Free WORKFILE="/tmp/df.work" # Holds filesystem data >$WORKFILE #... (0 Replies)
Discussion started by: draco
0 Replies

8. UNIX for Advanced & Expert Users

Problems filesystem

Hi, I've a Unixware 7.1.4, the machine has 3 disks, the second disk is not mounted, he said the message "WARNING: msgcnt 2 vxfs: mesg 021: vx_fs_init - /dev/dsk/c0b0t1d0s1 file system validation failure". I use the fsck command to check and repair, during the pocess apears messages to... (3 Replies)
Discussion started by: By_Jam
3 Replies

9. Shell Programming and Scripting

housekeeping

hey, I have to write a housekeeping script which would delete any files which are more than 10 days old, the file is named in such a fashion MYTEST20060101_182239.txt MYXML20060112_182879.xml MYEXCEL20060113_546321.xls If the current date is 20060112, then MYTEST20060101_182239.txt will be... (2 Replies)
Discussion started by: mpang_
2 Replies
Login or Register to Ask a Question