Hi,
I need to write a batch file/shell script that runs at specified intervals daily and deletes specified set of files.
Can anyone pls help me with the code.
Thanks,
Indom. (6 Replies)
UPDATE: Sorry, disregard this.
It did work, I made a mistake; I just shouldn't have been using maxdepth.
I do think it is good to know, however, that
find | grep '#' | xargs rm
will "clean up" funnily named files in a directory. Of course, some of those funnily named files are there... (0 Replies)
Hello friends,
I am compiling some set of SQL scripts in a set of sub directories demoed as below. After compiling log files are being created.
Each and every time after compiling time I had to go subdir by subdir to delete the log files. I am sure there should be simple way to look for all log... (4 Replies)
Hi!
Need your help. How can I delete the cache folder of multiple user home directories via automatically executed shell script on a Mac OS X Server?
Example:
The userdata are stored on a Xsan Volume like this:
/Volumes/Xsan/userdata/mike
/Volumes/Xsan/userdata/peter... (2 Replies)
Hi all -
I'm trying to rename a large number of files all at once and need some help figuring out the command line syntax to do it. I've already done quite a bit of research with the rename and mv commands, but so far haven't found a solution that seems to work for me. So:
The files exist... (10 Replies)
Hi everyone! I'm sorry, I'm a total noob but would really appreciate any advice or help. I want to create a cron job that would run every hour and would look inside a few different folders. If any new files were created within those folders within the last hour they would be destroyed, but any... (2 Replies)
I have just purchased my first ever Apple computer - and am therefore new to UNIX also.
I would like to create a simple "batch file" (apologies if this is the wrong terminology) to do the following:
When I plug my camera into the MAC it automatically downloads photos and videos into a new... (1 Reply)
Hello everyone. I am new to shell scripting and i am required to create a shell script, the purpose of which i will explain below.
I am on a solaris server btw.
Before delving into the requirements, i will give youse an overview of what is currently in place and its purpose.
... (2 Replies)
OS: SUNOS 5.10 i386
Hello guys I wrote a shell script in bash shell to delete the files less than 30 days old. The following is the script.
=======================================
#!/bin/bash
for dirs in `/clu04/oracle/directory_list.lst`
do
find $dirs -type f -mtime -30 -exec rm {} \;... (3 Replies)
Hello,
i have an dynamical apache_cache that I need to clean all days (older tant one day) with an unix command :
find /usr/IBM/HTTPServer/apache_cache/ -name '*' -mtime +1 -print0|xargs -0 rm -r --
but it didn't work.
Could you explain me why.
So I will put below all my script :... (13 Replies)
Discussion started by: steiner
13 Replies
LEARN ABOUT SUSE
lastlog
LASTLOG(8)LASTLOG(8)NAME
lastlog - examine lastlog file
SYNOPSIS
lastlog [options]
DESCRIPTION
lastlog formats and prints the contents of the last login log /var/log/lastlog file. The
login-name, port, and last login time will be printed. The default (no flags) causes lastlog entries to be printed, sorted by their order
in /etc/passwd.
OPTIONS
The options which apply to the lastlog command are:
-h, --help
Print help message and exit.
-t, --time DAYS
Print the lastlog records more recent than DAYS.
-u, --user LOGIN
Print the lastlog record for user with specified LOGIN only.
The -t flag overrides the use of -u.
If the user has never logged in the message
**Never logged in** will be displayed instead of the port and time.
NOTE
The lastlog file is a database which contains info on the last login of each user. You should not rotate it. It is a sparse file, so its
size on the disk is much smaller than the one shown by ls -l (which can indicate a really big file if you have a high UID). You can display
its real size with ls -s.
FILES
/var/log/lastlog
lastlog logging file
CAVEATS
Large gaps in uid numbers will cause the lastlog program to run longer with no output to the screen (i.e. if mmdf=800 and last uid=170,
program will appear to hang as it processes uid 171-799).
AUTHORS
Julianne Frances Haugh (jockgrrl@ix.netcom.com)
Phillip Street
08/10/2005 LASTLOG(8)