- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- remove files with the use of crontab
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2001 01:19 AM
05-15-2001 01:19 AM
remove files with the use of crontab
Can anyone give me some directions how to make a script like that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2001 01:35 AM
05-15-2001 01:35 AM
Re: remove files with the use of crontab
week:
find / \( -name a.out -o -name '*.o' \) -atime +7 -exec rm {} \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2001 01:53 AM
05-15-2001 01:53 AM
Re: remove files with the use of crontab
find /disc/users -type f -name "*.dwg" -mtime +14 -exec rm -f {} \;
You don't need a script for this as you can put this command directly in the crontab. Just make sure you use the full path for the find and rm commands (/usr/bin/find and /usr/bin/rm).
Hope this helps. Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2001 02:30 AM
05-17-2001 02:30 AM
Re: remove files with the use of crontab
Wietze.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2001 10:19 AM
05-18-2001 10:19 AM
Re: remove files with the use of crontab
try this :
find /userdirectories -type f -name
Later, put this in a file ( chmod 755 ) and run in crontab.
For example whitch one hour :
0 * * * * ksh -c /dir/script
I hope help you.
Regards,
Abel Berger
I hope help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2001 11:16 AM
05-18-2001 11:16 AM
Re: remove files with the use of crontab
I.E.
>cat /usr/local/etc/cleanup_hosts
host1
host2
host3
>cat /usr/local/etc/junk_file_list
core
idmerr
*.roll
*.save
*.tmp
*.nfs
>cat /usr/local/sbin/cleanup.sh
#!/usr/bin/sh
DATE=`/usr/bin/date +%Y-%m-%d`
HOSTLIST=' /usr/local/etc/cleanup_hosts'
JUNKLIST='/usr/local/etc/junk_file_list'
LOG="/tmp/cleanup$DATE.log"
if [ -f $LOG ] ; then
/sbin/mv $LOG $LOG.old
fi
/usr/bin/touch $LOG
for HOST in `cat $HOSTLIST` ; do
for JUNK in `cat $JUNKLIST` ; do
echo "Removing $JUNK from $HOST" >>$LOG
/usr/bin/remsh $HOST '/usr/bin/find -name $JUNK -exec /usr/bin/rm -f {} \;' >>$LOG
done
done
DONT cut and paste any of this, cuz I wrote it from memory!, but I think you get the idea....
If you can do all your administration tasks from one seat, it makes maintenance much easier!
Regards,
Shannon