Sponsored Content
Full Discussion: INTO OUTFILE Error 2
Top Forums UNIX for Beginners Questions & Answers INTO OUTFILE Error 2 Post 303036324 by esgaroth32 on Sunday 23rd of June 2019 06:47:18 AM
Old 06-23-2019
The start of my script contains

Code:
#!/bin/bash
date=`date +%F`
prev_date=`date --date='-1 month' '+%Y-%m-25 00:00:00'`
cur_date=`date --date='now' '+%Y-%m-25 00:00:00'`
mkdir /tmp/VoipBilling-$date
mkdir /tmp/VoipBilling-$date/CDR
mkdir /tmp/VoipBilling-$date/Summary

When I do the following it creates the file with the date specified

Code:
mkdir /file-$date

--- Post updated at 11:47 AM ---

When I run the script I get the following error

Code:
ERROR 1 (HY000) at line 1: Can't create/write to file '/tmp/VoipBilling-2019-06-23/Summary/POSTPAID-SUMMARY-2019-06-23.csv' (Errcode: 2)
ERROR 1 (HY000) at line 1: Can't create/write to file '/tmp/VoipBilling-2019-06-23/Summary/PREPAID-SUMMARY-2019-06-23.csv' (Errcode: 2)
ERROR 1 (HY000) at line 1: Can't create/write to file '/tmp/VoipBilling-2019-06-23/Summary/VIRTUAL-PBX-SUMMARY-2019-06-23.csv' (Errcode: 2)
ERROR 1 (HY000) at line 1: Can't create/write to file '/tmp/VoipBilling-2019-06-23/CDR/BILLTEST-2019-06-23.csv' (Errcode: 2)
ERROR 1 (HY000) at line 1: Can't create/write to file '/tmp/VoipBilling-2019-06-23/CDR/BILLTEST2-2019-06-23.csv' (Errcode: 2)

So it is creating the dates correctly but it seems to not be able to write/create the file. Folder permisions should be fine. I run chmod -R 777 /temp/* at the start of the script

Code:
#!/bin/bash
date=`date +%F`
prev_date=`date --date='-1 month' '+%Y-%m-25 00:00:00'`
cur_date=`date --date='now' '+%Y-%m-25 00:00:00'`
mkdir /tmp/VoipBilling-$date
mkdir /tmp/VoipBilling-$date/CDR
mkdir /tmp/VoipBilling-$date/Summary

chmod -R 777 /tmp/*

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Setting outfile with (brackets)

I have a file that comes in as 20081002_invoices.txt and needs to go out as invoices(20081002).xls When ran this file should have three seperate fields as follows: column1 column2 column3 data1 data2 data3 when i run the script it produces the invoices(20081002).xls but moves... (1 Reply)
Discussion started by: Pablo_beezo
1 Replies

2. Shell Programming and Scripting

How to extract some parts of a file to create some outfile

Hi All, I am very new in programming. I need some help. I have one input file like: Number of disabled taxa: 9 Loading mapping file: ncbi.map Load mapping: taxId2TaxLevel: 469951 --- Subsample reads (20%): 66680 of 334386 Processing: tree-from-summary Running tree-from-summary... (21 Replies)
Discussion started by: iammitra
21 Replies

3. UNIX for Dummies Questions & Answers

How to outfile contant as an input for a command

I`m having output file which contain following no which changes every time i run script.The number given below are there in file and i have to fatch them from file. 12 15 56 158 365 165 598 568 265 256 258 now i want to use above number from output to input as $j r=`/omp/bin/ICIC... (1 Reply)
Discussion started by: nitin_aaa27
1 Replies

4. Shell Programming and Scripting

print to more than one outfile AWK

I'd like to do an if / else if condition and print to different files. Something like: awk '{ if ($1 == "yes") print $2, $4 < infile > outfile1 ; else if ($1 == "No") print $2, $4 < infile > outfile2 }' Obviously I don't know the syntax. Thanks so much. (5 Replies)
Discussion started by: dcfargo
5 Replies

5. Programming

"cout = outFile" is not compiled

Hello, Compilation of the line "cout = outFile" throws error "Error: std::ios_base::operator=(const std::ios_base&) is not accessible from std::ios ::operator=(const std::ios &)." outFile is declared as "static ofstream". Thanks, Shafi (3 Replies)
Discussion started by: shafi2all
3 Replies

6. Shell Programming and Scripting

Difference of two data files & writing to an outfile.

Hi Everyone, I have two files i.e. one file2 contains today's data and the other file1 contains Yesterday's data. The data in the files contains 226 columns and the data for the coulums separated by a Pipe "|" delimiter. Now, I have 4 Primary keys (coulumns) by which I have to compare file2 and... (10 Replies)
Discussion started by: filter
10 Replies

7. Shell Programming and Scripting

Copying the Header & footer Information to the Outfile.

Hi I am writing a perl script which checks for the specific column values from a file and writes to the OUT file. So the feed file has a header information and footer information. I header information isaround107 lines i.e. Starts with START-OF-FILE ....... so on .... ... (11 Replies)
Discussion started by: filter
11 Replies

8. UNIX for Dummies Questions & Answers

Outfile

Hi guys! So I have a program that allows the user to enter a file, change some characters (for example, a changes to t, etc.) and then save the new file under a new name. However, I need to press carriage return twice for the program to end. I was just wondering if anyone knew of a way for the... (2 Replies)
Discussion started by: PerlNutt
2 Replies

9. UNIX for Dummies Questions & Answers

xls2csv.py won't print to outfile

Hi, I'm trying to use pyExcelerator's module "xls2csv" converter in ubuntu. The following works great, except the standard out is in the terminal. sudo python xls2csv.py test.xls I want the csv delimited output to be redirected to a file. When I enter.... sudo python xls2csv.py test.xls... (5 Replies)
Discussion started by: jdilts
5 Replies

10. Solaris

Solaris 10 error "-sh: /tmp/outfile: cannot create"

Hello, Each time a user log on to host, they receive below error: -sh: /tmp/outfile: cannot create Example: $ ssh host user@host's password: Last login: Fri Dec 4 08:17:28 2015 from client.ref |-----------------------------------------------------------------| -sh:... (2 Replies)
Discussion started by: feroccimx
2 Replies
widget_calendar(n)					    widget::calendar Megawidget 					widget_calendar(n)

__________________________________________________________________________________________________________________________________________________

NAME
widget_calendar - widget::calendar Megawidget SYNOPSIS
package require Tcl 8.4 package require Tk 8.4 package require widget ?3.0? widget::calendar pathname ?options? _________________________________________________________________ DESCRIPTION
This package provides a calendar megawidget (snidget). widget::calendar pathname ?options? WIDGET OPTIONS
-command A script to evaluate when a date was selected. -dateformat The format of the date that is returned. Default: %m/%d/%Y. -firstday Set first day the week, Either sunday or monday. It defaults to monday. -font Select the font used in the widget. It defaults to Helvetica 9. -highlightcolor Selects the background color for the day that has been selected. Default: #FFCC00 -language Specify language of the calendar contents. The language is specified by abbreviations of the languge, for example: en - english, de - german ... It defaults to en. Supported languages: en, de, fr, it, es, pt, ru, sv, zh, fi -shadecolor Selects the color of the parts that have a shaded background. Default: #888888 -showpast Specify if the past shall be shown. It is a boolean value and defaults to 1. -textvariable Specifies the name of a variable whose value is linked to the entry widget's contents. Whenever the variable changes value, the widget's contents are updated, and vice versa. WIDGET COMMAND
pathname get ?what? Returns a part of the selected date or 'all'. The argument what selects the part. Valid values for what are: day, month, year and all. 'all' is the default and returns the complete date in the format given with -dateformat. DEFAULT BINDINGS
On creation of the calendar widget the following bindings are installed. o Up - Move to week before current date o Down - Move to week after current date o Left - Move to day before current date o Right - Move to day after current date o Control-Left - Move to month before current date o Control-Right - Move to month after current date o Control-Up - Move to year before current date o Control-Down - Move to year after current date EXAMPLE
package require widget::calendar ; # or widget::all set t [widget::calendar .t] pack $t -fill x -expand 1 KEYWORDS
megawidget, snit, widget widget 0.93 widget_calendar(n)
All times are GMT -4. The time now is 01:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy