Visit Our UNIX and Linux User Community

Top Forums Shell Programming and Scripting Find and delete files and folders which are n days older from one unix server to another unix server Post 302606608 by sachinkl on Monday 12th of March 2012 08:47:37 AM
Old 03-12-2012
Find and delete files and folders which are n days older from one unix server to another unix server

Hi All,

Let me know how can i find and delete files from one unix server to another unix server which are 'N' days older.

Please note that I need to delete files on remote unix server.So, probably i will need to use sftp, but question is how can i identify files and folders which are 'N' days older. As we know, we can't use find command to identify as sftp command don't support that.

Any help will be appreciated !!!
Test Your Knowledge in Computers #345
Difficulty: Medium
Scott McNealy received $238 million USD when the Oracle acquisition closed.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

delete files and folders older than 3 days

find /basedirectory -type f -mtime +3 >> /tmp/tempfile find /basedirectory -type d -mtime +3 >> /tmp/tempfile mailx -s "List of removed files and folders" < /tmp/te mpfile rm /tmp/tempfile find /basedirectory -type f -mtime +3 -exec rm {} \; find /basedirectory -type d... (7 Replies)
Discussion started by: melanie_pfefer
7 Replies

2. Shell Programming and Scripting

Delete files older than 2 days using shell script in Unix

I'm new to shell script.... can any one help... What is the shell script to delete the files older than 2 days ? (3 Replies)
Discussion started by: satishpabba
3 Replies

3. Red Hat

Find files older than 30 days in directories and delete them

Hi, I have dummies questions: My script here can find the files in any directories older than 30 days then it will delete the files but not the directories. I would like to also be able to delete the directories that hold old files more than 30 days not just the files itself. find . -type f... (2 Replies)
Discussion started by: lamoul
2 Replies

4. Shell Programming and Scripting

Delete folders older than 30 days

Dear all, i use incremental backup my data with .zip to my hard drive. what i need is i don't want the old .zip file older than 30 days. how to write a shell script automatically remove my external hard disc zip backup folders older than 30 days? Regards, (2 Replies)
Discussion started by: joneggk
2 Replies

5. Shell Programming and Scripting

How archive the older than 30 day files to another unix server

I need to archive the older than 30 day file to another uinx server.I have wrote the below uinx script. for LOOK_DIR in /TempFiles do for FILE in `find ${LOOK_DIR} -mtime -30 -exec ls {} \;` do echo ${FILE} >> file_list ## This file will have the list of files copied and... (12 Replies)
Discussion started by: murari83.ds
12 Replies

6. Shell Programming and Scripting

Unix shell script to delete files on windows server

Hi experts, can anyone suggest me on the below: how to write a shell script to search and delete files on windows server. -script runs on unix box -it should search for specific files on windows server and delete them periodically. (2 Replies)
Discussion started by: chpradeepch
2 Replies

7. Shell Programming and Scripting

scp files that are 3 days older from remote server-

hello, i am trying to get a list of files to be scped from the remote server by running the below in my local unix server ( note - there is a passwordless connectivity setup made between the local and remote server) and, we use KSH. --- ssh $scp_host "find /a/b/c/*/ -iname "$remote_file"" >... (4 Replies)
Discussion started by: billpeter3010
4 Replies

8. Shell Programming and Scripting

Find command to search and delete files older than 1 days at a desired location

Hello All, Can someone please help me out in creating the find command to search and delete files older than 1 days at a desired location. Thanks in advance for your help. (3 Replies)
Discussion started by: Pandee
3 Replies

9. Shell Programming and Scripting

How to create zip/gz/tar files for if the files are older than particular days in UNIX or Linux?

I need a script file for backup (zip or tar or gz) of old log files in our unix server (causing the space problem). Could you please help me to create the zip or gz files for each log files in current directory and sub-directories also? I found one command which is to create gz file for the... (4 Replies)
Discussion started by: Mallikgm
4 Replies

10. Shell Programming and Scripting

Find files not matching multiple patterns and then delete anything older than 10 days

Hi, I have multiple files in my log folder. e.g: a_m1.log b_1.log c_1.log d_1.log b_2.log c_2.log d_2.log e_m1.log a_m2.log e_m2.log I need to keep latest 10 instances of each file. I can write multiple find commands but looking if it is possible in one line. m file are monthly... (4 Replies)
Discussion started by: wahi80
4 Replies
NWAUTH(1)							      nwauth								 NWAUTH(1)

nwauth - Verify username/password SYNOPSIS
nwauth [ -h ] [ -S server ] [ -U user name ] [ -P password | -n ] [ -D ] DESCRIPTION
nwauth does nothing but logging into a NetWare server. If the login was successful, an error code of 0 is returned. If the login was not successful, an error code of 1 is returned. It was designed for use by other programs who want authenticate users via a NetWare server. If there is no -P or -n option specified on command line, nwauth always expects a password on stdin. If the stdin is a tty, then the user is prompted for a password. Otherwise nwauth simply reads stdin for a password. nwauth looks up the file $HOME/.nwclient to find a file server and a user name if they are not specified on command line. See nwclient(5) for more information. Please note that the access permissions of .nwclient MUST be 600, for security reasons. OPTIONS
-h -h is used to print a short help text. -S server server is the name of the server you want to use. -U user name If the user name your NetWare administrator gave to you differs from your unix user-id, you should use -U to tell the server about your NetWare user name. -D nwauth says that your password is correct if you have existing connection to server with name user name. This is handy for some shell scripts, but it is unacceptable for authorization modules, such as PAM, PHP or Apache. It was pointed to me that this behavior was not well known, and there exist at least one PAM module which does not know that (this module is not part of ncpfs; you should use PAM mod- ule which comes with ncpfs instead anyway). SEE ALSO
nwclient(5) CREDITS
nwauth was written by Volker Lendecke ( nwauth 10/27/1996 NWAUTH(1)

Featured Tech Videos

All times are GMT -4. The time now is 08:40 PM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy