Hi,
I am trying to write a script that will move all the files from source directory structure(multiple levels might exist) to destination directory structure. If a sub folder is source doesnot exist in destination then I have to skip and goto next level. I also need to delete the files in... (4 Replies)
Say folder archive/ contains many folder each created on a day. this folder may contain files. i want to write a script to delete all the folder inside archive/ which are 7 days older. i used the below script for the reason.
find archive -mtime +7 -type d -exec rm -r {} \;
pls suggest me if... (3 Replies)
I Need help for one requirement,
I want to move the latest/Older file in the folder to another file. File have the datetimestamp in postfix.
Example:
Source Directory : \a
destination Directory : \a\b
File1 : xy_MMDDYYYYHHMM.txt (xy_032120101456.txt)
File2: xy_MMDDYYYYHHMM.txt... (1 Reply)
Hi
I am facing problem in using this command,
mv `find /export/june/PURGEDATA*.txt -mtime +2 -exec ls {} \;` june/archive/
mv: Insufficient arguments (1)
Usage: mv f1 f2
mv f1 ... fn d1
mv d1 d2
Thank you in advance (2 Replies)
Hi All
I want to remove the files with name like data*.csv from the directory older than 10 days.
If there is no files exists to remove older than 10 days, It should not do anything.
Thanks
Jo (9 Replies)
how do i remove sub directories of a directory and all files which are older than 7 days by a single command in AIX. pls help me.
I am using command as
#find /gpfs1/home/vinod/hpc/ -depth -type d -mtime +7 -exec rm -rf {} \;
so i want to delete all sub directories and all files from the... (1 Reply)
Hello,
I have a script which finds files in a directory that are older than 30 days and moves them to the specified directory.
The problem is I don't know why it works the way it does?
Code:
find . -name '*.sql' ! -mtime -30 -exec mv '{}' /dataload/archivelogs \;
I was under the... (4 Replies)
Hello all,
do you know any way i can i move folders and its content if folder is older than 1,5 days in bash?
I tried:
find /home/xyz/DATA/* -type d -ctime +1.5 -exec mv "{}" /home/xyz/move_data_here/ \;All i got was that Files from DATA /home/xyz/DATA/* ended messed up in... (1 Reply)
Hi,
I am trying to run a command that finds all files over x amount of days, issue is one of the directories has spaces within it.
find /files/target directory/*/* -type f -mtime +60 When running the above the usual error message is thrown back
+ find '/files/target\' 'directory/*/*' -type... (1 Reply)
Discussion started by: Ads89
1 Replies
LEARN ABOUT MINIX
backup
BACKUP(8) System Manager's Manual BACKUP(8)NAME
backup - backup files
SYNOPSIS
backup [-djmnorstvz] dir1 dir2
OPTIONS -d At top level, only directories are backed up
-j Do not copy junk: *.Z, *.bak, a.out, core, etc
-m If device full, prompt for new diskette
-n Do not backup top-level directories
-o Do not copy *.o files
-r Restore files
-s Do not copy *.s files
-t Preserve creation times
-v Verbose; list files being backed up
-z Compress the files on the backup medium
EXAMPLES
backup -mz . /f0 # Backup current directory compressed
backup /bin /usr/bin
# Backup bin from RAM disk to hard disk
DESCRIPTION
Backup (recursively) backs up the contents of a given directory and its subdirectories to another part of the file system. It has two typ-
ical uses. First, some portion of the file system can be backed up onto 1 or more diskettes. When a diskette fills up, the user is
prompted for a new one. The backups are in the form of mountable file systems. Second, a directory on RAM disk can be backed up onto hard
disk. If the target directory is empty, the entire source directory is copied there, optionally compressed to save space. If the target
directory is an old backup, only those files in the target directory that are older than similar names in the source directory are
replaced. Backup uses times for this purpose, like make. Calling Backup as Restore is equivalent to using the -r option; this replaces
newer files in the target directory with older files from the source directory, uncompressing them if necessary. The target directory con-
tents are thus returned to some previous state.
SEE ALSO tar(1).
BACKUP(8)