Sponsored Content
Full Discussion: Remove file isn't working
Top Forums Shell Programming and Scripting Remove file isn't working Post 303046019 by mustfirst on Tuesday 21st of April 2020 05:55:49 PM
Old 04-21-2020
Remove file isn't working

I'm trying to delete the files that are 5 days old..
Clearly the modified date is April 15 for workorders.sql
My code won't delete it. However if I use +4 then it will delete it. Am I missing something?

Code:
-rw-r--r-- 1 dbadmin dbadmin    1331824 Apr 15 18:34 wmweb_test.sql.gz
-rw-r--r-- 1 dbadmin dbadmin 6531478011 Apr 15 19:10 workorders.sql


Code:
find ~/delete/2020-04-15/*.sql -type f -atime +5 -exec rm -rf '{}' \;

I also tried with but it still doesn't delete the file.
Code:
find ~/delete/2020-04-15/*.sql -type f -mtime +5 -exec rm -rf '{}' \;
find ~/delete/2020-04-15/*.sql -type f -ctime +5 -exec rm -rf '{}' \;

 

10 More Discussions You Might Find Interesting

1. Solaris

grep -r isn't working

Hi, I was trying to use this particular option of grep grep -r 'Search_pattern' * This command should ideally search all the occurrences of Search_pattern recursively within a directory & print it on shell prompt. But this command is not doing what is expected. It just displays nothin! ... (8 Replies)
Discussion started by: harishmitty
8 Replies

2. UNIX for Dummies Questions & Answers

Which Sendmail version ? and why -d isn't working

Hi, I am trying to figure out which version I am running of sendmail, but I am buffed. This is what I get sendmail -d0.1 -bt < /dev/null sendmail: illegal option -- d Telneting to my host: ~]$ telnet localhost 25 Trying 127.0.0.1... Connected to localhost. Escape character is... (1 Reply)
Discussion started by: saariko
1 Replies

3. UNIX for Dummies Questions & Answers

Why isn't this working? tsch-doit file

#! /usr/tsch foreach f (`cat contacts.list`) awk '{printf ($2 in a) ? ","$5 : (NR>1) ? RS $2 FS $5 : $2 FS $5; a} END{print e}' $f > $f_inter.map end My file: cat contacts.list is just a list of files. I get this error: doit_contacts2intermap.sh: Command not found. Thanks! (1 Reply)
Discussion started by: lost
1 Replies

4. Shell Programming and Scripting

a very basic sed one-liner...that isn't working :-(

Greetings all. :) I would like to use sed to join all non-blank lines together in a particular file. I was thinking I could do this by simply replacing the terminating, new-line character on every line which is not blank, but I must be missing something in my sed line: $ sed... (3 Replies)
Discussion started by: SteveB-in-LV
3 Replies

5. Shell Programming and Scripting

awk isn't working

awk 'BEGIN{print '1.2449'**0.5}' awk: line 1: syntax error at or near * can someone help me troubleshoot the above command? i'm trying to do the square root of 1.2449. this command works on Red Hat, but for some reasonn isn't working on kubuntu (latest version). shell is bash. i... (3 Replies)
Discussion started by: SkySmart
3 Replies

6. Shell Programming and Scripting

crontab - runninf a java script just isn't quite working...

hi gurus. I have a little script that runs java from a certain directory. This script runs fine when run manually but when I try to schedule it, it fails to find the script. little_script.sh.. /<directory of java>/java -classpath... (3 Replies)
Discussion started by: MrCarter
3 Replies

7. Shell Programming and Scripting

String == isn't working in [[-test

Hi. I'm new to this forum, my English perhaps is not so good, but here is my question: In bash you can use ] for tests, and how I understand it the variable names should be expanded automatically. So this should give "yes": xx=hello $ ] && echo yes || echo no no # not giving "yes" These two... (2 Replies)
Discussion started by: 244an
2 Replies

8. Shell Programming and Scripting

export of a variable isn't working

Hi I want export input data ... echo "month: " read m export m=$m also export m is not working ? the month-variable should be exportet for the use in other scripts, but it is not working like this. What i'm doing wrong? Thanks in advance! IMPe (10 Replies)
Discussion started by: IMPe
10 Replies

9. Shell Programming and Scripting

Chmod working in sudo run script but chown isn't

My git user has permission in sudoers to run a wrapper script to move files into my webroot. Everything is working fine except for the chown line. After the script has run, the files ar still root:root instead of apache:apache. Scratching my head...:confused: #!/bin/sh echo echo "****... (4 Replies)
Discussion started by: dheian
4 Replies

10. HP-UX

Syslog daemon isn't working

Hi All, I've tried starting syslogd on our hp-ux 11.31 server. However, it is not getting started nor it is updating the syslog file. There is no space issue also. However, the mail.log file is approx 2GB, can that be of any issue. Please find the details below: # /sbin/init.d/syslogd... (2 Replies)
Discussion started by: Kits
2 Replies
DBIx::Class::Admin(3pm) 				User Contributed Perl Documentation				   DBIx::Class::Admin(3pm)

NAME
DBIx::Class::Admin - Administration object for schemas SYNOPSIS
$ dbicadmin --help $ dbicadmin --schema=MyApp::Schema --connect='["dbi:SQLite:my.db", "", ""]' --deploy $ dbicadmin --schema=MyApp::Schema --class=Employee --connect='["dbi:SQLite:my.db", "", ""]' --op=update --set='{ "name": "New_Employee" }' use DBIx::Class::Admin; # ddl manipulation my $admin = DBIx::Class::Admin->new( schema_class=> 'MY::Schema', sql_dir=> $sql_dir, connect_info => { dsn => $dsn, user => $user, password => $pass }, ); # create SQLite sql $admin->create('SQLite'); # create SQL diff for an upgrade $admin->create('SQLite', {} , "1.0"); # upgrade a database $admin->upgrade(); # install a version for an unversioned schema $admin->install("3.0"); REQUIREMENTS
The Admin interface has additional requirements not currently part of DBIx::Class. See DBIx::Class::Optional::Dependencies for more details. ATTRIBUTES
schema_class the class of the schema to load schema A pre-connected schema object can be provided for manipulation resultset a resultset from the schema to operate on where a hash ref or json string to be used for identifying data to manipulate set a hash ref or json string to be used for inserting or updating data attrs a hash ref or json string to be used for passing additional info to the ->search call connect_info connect_info the arguments to provide to the connect call of the schema_class config_file config_file provide a config_file to read connect_info from, if this is provided config_stanze should also be provided to locate where the connect_info is in the config The config file should be in a format readable by Config::General config_stanza config_stanza for use with config_file should be a '::' delimited 'path' to the connection information designed for use with catalyst config files config Instead of loading from a file the configuration can be provided directly as a hash ref. Please note config_stanza will still be required. sql_dir The location where sql ddl files should be created or found for an upgrade. sql_type The type of sql dialect to use for creating sql files from schema version Used for install, the version which will be 'installed' in the schema preversion Previous version of the schema to create an upgrade diff for, the full sql for that version of the sql must be in the sql_dir force Try and force certain operations. quiet Be less verbose about actions trace Toggle DBIx::Class debug output METHODS
create Arguments: $sqlt_type, \%sqlt_args, $preversion "create" will generate sql for the supplied schema_class in sql_dir. The flavour of sql to generate can be controlled by supplying a sqlt_type which should be a SQL::Translator name. Arguments for SQL::Translator can be supplied in the sqlt_args hashref. Optional preversion can be supplied to generate a diff to be used by upgrade. upgrade Arguments: <none> upgrade will attempt to upgrade the connected database to the same version as the schema_class. MAKE SURE YOU BACKUP YOUR DB FIRST install Arguments: $version install is here to help when you want to move to DBIx::Class::Schema::Versioned and have an existing database. install will take a version and add the version tracking tables and 'install' the version. No further ddl modification takes place. Setting the force attribute to a true value will allow overriding of already versioned databases. deploy Arguments: $args deploy will create the schema at the connected database. $args are passed straight to "deploy" in DBIx::Class::Schema. insert Arguments: $rs, $set insert takes the name of a resultset from the schema_class and a hashref of data to insert into that resultset update Arguments: $rs, $set, $where update takes the name of a resultset from the schema_class, a hashref of data to update and a where hash used to form the search for the rows to update. delete Arguments: $rs, $where, $attrs delete takes the name of a resultset from the schema_class, a where hashref and a attrs to pass to ->search. The found data is deleted and cannot be recovered. select Arguments: $rs, $where, $attrs select takes the name of a resultset from the schema_class, a where hashref and a attrs to pass to ->search. The found data is returned in a array ref where the first row will be the columns list. AUTHOR
See "CONTRIBUTORS" in DBIx::Class. LICENSE
You may distribute this code under the same terms as Perl itself perl v5.14.2 2011-05-10 DBIx::Class::Admin(3pm)
All times are GMT -4. The time now is 11:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy