Help needed to print the not updated files in the Directory
Hi All,
I have written one program to print the files which are not updated in the specified directory in .Dat file. If I am executing the same command in the command prompt its working fine but if I am executing in shell script it's not working fine. Please correct if any thing wrong in the below script
My requirement is, I want the files which are not updated in last 7 days
Please let me know what is the issue in that code.
At the moment I do not know anything UNIX script :rolleyes:
but i need to make script that prints the content of the archives
(of text) that are deposited in a directory and Later erases these
archives, leaving the directory emptiness
It would be like repository for print
please... (9 Replies)
Is there a shell command that will allow me to list index files in the /home directory for all users on a server that have been updated within the past 24 hours?
(e.g. index.htm .html .php in/home/user1/public_html /home/user2/public_html /home/user3/public_html etc ) (2 Replies)
I am new to shell scripting. Can someone help me out with this one please?
I need to write a script fot the following scenario:
I am currently in /parent directory.
I have a set of files in /parent/error_files directory
My script has to search for a file in /parent/erratic_files... (1 Reply)
Hi All,
I am stuck with a problem and i want your help, what i want to do is
I have a directory name dircome
and there are 6 files present in this directory, the name of the files are d1,d2,d3,d4,d5,d6.
The Perl script print the files name, means the output should be
d1
d2
d3
d4
d5
d6 (9 Replies)
Hi,
I am trying to work on this script that needs to monitor a Directory.
In case there are no files received in that Directory for the last 5 minutes, it has to send out an alert.
Could someone please suggest any approach for the same.
Note: I did check out various previous psts -... (8 Replies)
Hi with the help of Gabriel canepa, i have just edited filename only in his code. The help which i got and he helped is
1) I have around 22 logs and each log should be updated in the last 24 hours from the current timestamp.
2) It should check for ERROR message (not error,Error) in the log and... (2 Replies)
Hi
My directory structure is as below.
dir1, dir2, dir3
I have the list of files to be deleted in the below path as below.
/staging/retain_for_2years/Cleanup/log $ ls -lrt
total 0
drwxr-xr-x 2 nobody nobody 256 Mar 01 16:15 01-MAR-2015_SPDBS2
drwxr-xr-x 2 root ... (2 Replies)
Given a directory containing say a few thousand files,
please output a list of all the names of the files in the directory that are exactly the same, i.e. have the same contents.
func(a_directory_name) output -> {“matches”: , ... ]}
e.g. func(“/home/my/files”) where the directory... (7 Replies)
Hi All,
I hope somebody would be able to help me.
I would need to search a string coming from a file, example file.txt:
dog
cat
goat
horse
fish
For every string, I would need to know if there are any files inside a directory(recursively) that contains the string regardless of case.... (9 Replies)
I have a directory of files, I can show the number of lines in each file and order them from lowest to highest with:
wc -l *|sort
15263 Image.txt
16401 reference.txt
40459 richtexteditor.txt
How can I also print the number of unique lines in each file?
15263 1401 Image.txt
16401... (15 Replies)
Discussion started by: spacegoose
15 Replies
LEARN ABOUT DEBIAN
slack
slack(8) System Manager's Manual slack(8)NAME
slack - Sysadmin's lazy autoconfiguration kit
SYNOPSIS
slack [option ...] [role ...]
DESCRIPTION
slack is a master command which coordinates the activities of its backends, which variously:
o determine the list of roles to be installed on this server
o create a local cached copy of the role files from the central repository
o merge file trees from subroles into a single, unified tree
o install files onto the local filesystem
o run scripts before and after installation
Options you give to slack will be generally passed along to the backends where relevant.
OPTIONS -h, --help
Print a usage statement.
--version
Print the version and exit.
-v, --verbose
Increase verbosity. Can be specified multiple times.
--quiet
Don't be verbose (Overrides previous uses of --verbose).
-C, --config FILE
Use the specfied FILE for configuration instead of the default, /etc/slack.conf.
-s, --source DIR
Source directory for slack files
-e, --rsh COMMAND
Remote shell for rsync
-c, --cache DIR
Local cache directory for slack files
-t, --stage DIR
Local staging directory for slack files
-r, --root DIR
Root destination for slack files
--no-sync
Skip the slack-sync step (useful if you're pushing stuff into the CACHE outside slack).
--no-files
Don't install any files in ROOT, but tell rsync to print what it would do.
--no-scripts
Don't run scripts
-n, --dry-run
Same as --no-files --no-scripts (CACHE, STAGE will still be updated)
--role-list
Role list for slack-getroles(8).
-b, --backup
Make backups of existing files in ROOT that are overwritten. This option defaults to on if it is not set to 0 in a config file or
disabled with --nobackup on the command line.
--backup-dir
Put backups from the --backup option into this directory.
-H, --hostname HOST
Pretend to be running on HOST, instead of the name given by gethostname(2).
--preview MODE
Do a diff of scripts and files before running them. MODE can be one of 'simple' or 'prompt' (See PREVIEW MODES, below).
--diff PROG
Use this diff program for previews.
--sleep TIME
Randomly sleep between 1 and TIME seconds before starting operations. Useful in crontabs.
PREVIEW MODES
Preview functionality is new in slack 0.14.0. I haven't quite worked out how things will work, so this usage is somewhat subject to change
in future versions. I thought I would try it this way and see how people like it.
In 'simple' mode, after syncing and staging the files directory, slack will present a diff of the files and scripts. In this mode, slack
will not run the preinstall or fixfiles scripts, and because of this, it may provide some false output about permissions changes to files.
In 'prompt' mode, after syncing and staging the files directory, slack will diff the script directory. If there are differences, slack
will present them to you and ask you if you want to continue. If you say no, it will exit. If you say yes, it will stage the scripts
directory, run the preinstall and fixfiles scripts, and then diff the files in the stage with those in the root. If there are differences,
slack will present them to you and ask you if you want to continue. If you say no, it will exit. If you say yes, it will install the
files and run the postinstall script.
So, the 'simple' mode is easy to use, and will be accurate if you don't use fixfiles. The 'prompt' mode will be accurate if you use fix-
files, but requires some interaction.
Why can't we just have one mode that works with fixfiles and requires no interaction? Well, that would require slack to understand what
your free-form fixfiles executable was going to do, which would either require some kind of universe simulator or would require you to
write your fixfiles in a less free-form way, which would make slack less like slack.
EXAMPLES
To install all the roles configured in the role list for a server:
slack
To install a specific role:
slack rolename
To test a new role before checking in the changes:
slack --source user@workstation:/home/user/.../slack rolename
To avoid killing your master server when calling from cron:
slack --sleep 3600
FILES
/etc/slack.conf
SEE ALSO slack.conf(5), rsync(1)Administrative commands 2004-10-22 slack(8)