Hi,
I have a coupel of files in /tmp which I have to copy to /var. But I want their name to be same as the source with date suffix.
But the problem is I don;t know the prefix of the file, I only know the suffix of file.
AAA.997
ABC.997
ADC.997
The later part 997 is constant but the... (1 Reply)
I have few webservers logs like access.log. which would be growing everyday.
what i do everyday is, take the backup of access.log as access.log_(currentdate) and nullify the access.log.
So thought of writing a script... but stuck up in middle.
My requirement: to take the backup and nullify... (6 Replies)
When I do a ls -lt I get a list of files by date modified from newest to oldest. I would like to be able to copy some files to another directory using a date last modified range (i.e. Apr 30 - May 13) How could I do this?
Thanks,
Joe (4 Replies)
I am a newbie to scripting.
I need a korn shell script to copy log files of current day to archive folder and rename with current days date stamp.
I would really appreciate your help.
File structure is as follows. Everyday files get overwritten, so I need copy to a archive directory and... (3 Replies)
Hi all
i am having so many files in my directory.Is there any option
to copy files based on date.
example
i am having file this
-rw-rw-r-- 1 ram user 1 Feb 2 17:12 abc
-rw-rw-r-- 1 ram user 1 Feb 2 17:12 bnw
-rwxrwxr-x 1 ram user 21122 Feb 4... (3 Replies)
Hi All,
I am new to scripting and am looking for some assistance setting up a script. Basically I need the script to scan a folder for the newest files and make a copy of those files, adding a month to the date stamp. I also need this script to delete the previously copied files to save space.... (4 Replies)
i have directory /abcd and i want to copy all today date files in /xyz directory.
i am able to see the files by using below command but not able to understand copy.
find . -mtime -1 -type f -exec ls -l {} \; (2 Replies)
Can someone draw up a script that for every file, folder and subfolder and files that will copy the creation date over top of the modified date??
I know how to touch every file recursively, but no idea how to read a files creation date then use that to touch the modification date of that file,... (3 Replies)
Hi everyone :-)
I ran into a small issue. I would like to copy some files in the precise order they were created.
So the oldest files should be copied first and the newest ones last.
I tried cp -r $(ls -1t) ./destination but the files are still not sorted properly. I was thinking, that... (11 Replies)
Discussion started by: officiallyme
11 Replies
LEARN ABOUT PLAN9
mkfs
MKFS(8) System Manager's Manual MKFS(8)NAME
mkfs, mkext - archive or update a file system
SYNOPSIS
disk/mkfs [-aprv] [-n name] [-s source] [-u users] [-z n] proto ...
disk/mkext [-d name] [-u] [-h] [-v] file ...
DESCRIPTION
Mkfs copies files from the file tree source (default /) to a kfs file system (see kfs(4)). The kfs service is mounted on /n/kfs, and
/adm/users is copied to /n/kfs/adm/users. The proto files are read, and any files specified in them that are out of date are copied to
/n/kfs.
Each line of the proto file specifies a file to copy. Indentation is significant, with each level of indentation corresponding to a level
in the file tree. Fields within a line are separated by white space. The first field is the last path element in the destination file
tree. The second field specifies the permissions. The third field is the owner of the file, and the fourth is the group owning the file.
The fifth field is the name of the file from which to copy; this file is read from the current name space, not the source file tree. All
fields except the first are optional.
Names beginning with a are expanded as environment variables. If the first file specified in a directory is all of the files in that
directory are copied. If the first file is all of the files are copied, and all subdirectories are recursively copied.
Mkfs copies only those files that are out of date. Such a file is first copied into a temporary file in the appropriate destination direc-
tory and then moved to the destination file. Files in the kfs file system that are not specified in the proto file are not updated and not
removed.
The options to mkfs are:
a Instead of writing to a kfs file system, write an archive file to standard output, suitable for mkext. All files in proto, not just
those out of date, are archived.
n name Use kfs.name as the name of the kfs service (default kfs).
p Update the permissions of a file even if it is up to date.
r Copy all files.
s source
Copy from files rooted at the tree source.
u users
Copy file users into /adm/users in the new system.
v Print the names of all of the files as they are copied.
z n Copy files assuming kfs block n (default 1024) bytes long. If a block contains only 0-valued bytes, it is not copied.
Mkext unpacks archive files made by the -a option of mkfs. The -d option specifies a directory (default /n/kfs) to serve as the root of
the unpacked file system. The -u option, to be used only when initializing a new fs(4) file system, sets the owners of the files created
to correspond to those in the archive and restores the modification times of the files. (This is only permitted at the initial load of the
files into a file system.) Each file on the command line is unpacked in one pass through the archive. If the file is a directory, all
files and subdirectories of that directory are also unpacked. When a file is unpacked, the entire path is created if it does not exist.
If no files are specified, the entire archive is unpacked; in this case, missing intermediate directories are not created. The -v option
prints the names and sizes of files as they are extracted; -h prints headers for the files on standard output instead of unpacking the
files.
EXAMPLES
Make an archive to establish a new file system:
disk/mkfs -a -u files/adm.users -s dist proto > arch
Unpack that archive onto a new file system:
srv il!newfs
mount -c /srv/il!newfs /n/newfs
disk/mkext -u -d /n/newfs < arch
FILES
/lib/proto
directory of prototype files.
/lib/proto/portproto
generic prototype file.
SOURCE
/sys/src/cmd/disk/mkfs.c
/sys/src/cmd/disk/mkext.c
SEE ALSO prep(8), kfscmd(8), wren(3), pip(8)MKFS(8)