Sponsored Content
Top Forums Shell Programming and Scripting Need Help with a Shell Script for a Job Post 302987621 by Corona688 on Tuesday 13th of December 2016 11:07:34 AM
Old 12-13-2016
With instructions this big and vague, it's hard to give better answers than "step 1: have an sftp server". Really, all I have are questions.

1a) Do you have any control over what is sending the files? If at all possible, you should have the sender move the file to a different folder once it's finished sending, to signal that the file is complete. Trying to tell if an upload is complete or not without the client's assistance is really hard and error-prone.

1b) Does anyone but this process need to access those files? Ideally it could have its own account, locked to sftponly.

2a) "Passed onto the internal network" - what does that mean?
2b) 'comes to folder a' - on the same machine or a different one?
2c) Transferred how?

3a) How was it encrypted? 7zip, same as later?

4a) Do you have mail configured on your linux system?

5a) Copied or moved?
5b) Are you keeping the originals? Why or why not?
This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Multiple instances of the job in shell script.

Hi, Please let us know how to create a multiple instances of a job in the shell script. Thanks. Gangegowda K.G (1 Reply)
Discussion started by: Gangegowda
1 Replies

2. Shell Programming and Scripting

Cron job shell script..

Hey Guys, i was trying out a shell script which has to remove a file for every 90 mins. this is the code i came up with . $ crontab -e file1 file1 contains 30 1 * * * * rm -r /folder1/folder2/somefile.txt Now i need the cron to run for every 90 mins. the problem with this is... (8 Replies)
Discussion started by: Irishboy24
8 Replies

3. Shell Programming and Scripting

Adding a job to crontab via shell script

Is it possible to add a job to crontab with a shell script? The existing jobs in the crontab should exist as it was. The new job should be appended. Also, the crontab file is /var/spool/cron/root. (1 Reply)
Discussion started by: proactiveaditya
1 Replies

4. UNIX for Dummies Questions & Answers

Job Status for running shell script

Hello, I am running a shell script whose execution often takes several hours to complete. Is there way I can get some kind of status update as the job is running? Something as simple as the start and the current time stamp. Thanks, Gussi (2 Replies)
Discussion started by: Gussifinknottle
2 Replies

5. Shell Programming and Scripting

I need to do a work to my job, but i m new in script shell, someone can help with this..

I need to do a work to my job, but i m new in script shell, someone can help with this.. :confused: Description Bsafe The command creates a backup directory of each month at the command line (arguments of the script). The names of directories to copy will always be specified for the... (4 Replies)
Discussion started by: strshel
4 Replies

6. Solaris

Shell Script gives error when run through cron job.

Hi, The following shell script runs without any problem when executed manulally. USED=$(df -h /arch | tail -1 | awk '{print $5}' | cut -d '%' -f 1) if then find /arch/AUBUAT/ -type f -mtime +0 | xargs rm find /arch/AUBMIG/ -type f -mtime +0 | xargs rm fi But the same gives below... (6 Replies)
Discussion started by: ksadiq79
6 Replies

7. UNIX for Dummies Questions & Answers

cron job for the created shell script

Hi am newbie for unix shell.. how to create a cron job for my already created shell script.:confused: Thanks! (1 Reply)
Discussion started by: vidhyaS
1 Replies

8. Shell Programming and Scripting

Exit Shell Script with background job

Hi all, I am trying to exit a shell script (c shell) while invoking a job (service) that must run in the background: ...... /mydir/runservice & exit ...... There are downstream jobs and scripts that need to be run, but they all 'wait' for the script to exit. The script 'hangs' and... (3 Replies)
Discussion started by: CKT_newbie88
3 Replies

9. UNIX for Dummies Questions & Answers

Shell script - Finding Autosys job status

Hi, There are 2000 jobs in the list and i need to draw their status. I put all the jobs in the list and trying to read one by one from the list and to find out the status. Help me out in correcting the script. #!/bin/csh for a in $(cat Jobs_List.txt); do source <<path>> autorep -j $a... (1 Reply)
Discussion started by: venkatesht
1 Replies

10. Shell Programming and Scripting

How to put the multiple job on-hold using shell script?

Hi.. I need to put multiple jobs on ON HOLD in Autosys.. please help me on this. For Example: 1)ABCD_EFGH_IJKL 2)abcd_efgh_ijkl (2 Replies)
Discussion started by: Maanjesh
2 Replies
Cone(C)

MAILTOOL(1)						  Cone: COnsole Newsreader And E					       MAILTOOL(1)

NAME
mailtool - Process mailboxes SYNOPSIS
mailtool [options...] USAGE
mailtool is a diagnostic utility for handling various operations on mailboxes. mailtool's main uses include: display the list of folders in a mailbox; displaying list of messages in a mailbox; and copying mailboxes. The following mailboxes can be accessed by mailtool: imap://userid@server[/options] An IMAP account. mailtool will prompt for the login password. imaps://userid@server[/options] An IMAP account accessed via an encrypted SSL connection. pop3://userid@server[/options] A POP3 account. mailtool will prompt for the login password. pop3s://userid@server[/options] A POP3 account accessed via an encrypted SSL connection. maildir:path A local maildir mailbox. path specifies the maildir's location relative to the home directory (NOT the current directory). mbox:path Local mbox mail folders. path specifies the path to an mbox folder file, or a directory containing mbox folders, relative to the home directory (NOT the current directory). inbox:path Local mbox mail folders, like "mbox:path"; additionally, the system spool mailbox is automatically copied to $HOME/Inbox, which is accessible as folder INBOX. The name of a remote IMAP or POP3 server may be followed by one or more options that control various settings of the IMAP or POP3 connection: /cram Do not open the account unless the server supports secure password authentication. Secure password authentication verifies the account's password using a challenge/response authentication mechanism (where the label "cram" comes from). The actual password is never actually transmitted to the server, and therefore cannot be intercepted while in transit over an untrusted network. Secure password authentication is not supported by all servers. This option may not work with some servers. This option does not enable secure password authentication, it only mandates its use. If the server supports secure password authentication, it will be used even without the /cram option. Traditional userid/password authentication will be used only if the server does not implement secure password authentication. The /cram option makes secure password authentication mandatory. The /cram option is marginally useful even with encrypted server connections. The secure password authentication never sends the explicit password to the server. Encryption makes it theoretically impossible to recover the password from an encrypted data connection; but with secure authentication the password is never sent over the connection in the first place (the password's validity is certified by exchanging certain mathematical calculations between the server and the client). If the server is compromised, the compromised server will not receive the account password (unless the password is recovered from the server in other ways). /imap Do not use the SMAP if the server claims the availability of this experimental mail access protocol, and fall back to IMAP compatibility mode (this option is meaningful only with "imap://" and "imaps://" URLs). /notls Do not upgrade a plain connection to an encrypted one. This option is primarily used for testing and debugging purposes. Sometimes this option might be useful with servers that claim to offer encryption, but are unable to do so when taken up on their offer. /novalidate-cert Do not validate the server's SSL certificate when using an encrypted connection. Normally the mail server's SSL certificate must be validate when using an encrypted connection. The certificate's name must match the server's name, and the certificate must be signed by a trusted certificate authority. The encrypted connection normally fails if the certificate cannot be validate. Validation requires that a list of trusted certificate authorities must be known and configured. It's simply impossible to know which certificate authorities are valid without an explicit list of valid, known, trusted, certificate authorities. If a trusted authority list is not configured, no certificate can be validated. If the server's certificate is a self-signed certificate (this is often used for testing purposes), or if it's not signed by a known authority, the encrypted connection fails. This /novalidate-cert option disables certificate validation. The encrypted connection will be established even if the server's certificate would otherwise be rejected. Note This option is applicable even when an encrypted IMAP or POP3 connection is not explicitly requested. Many mail servers are capable of automatically upgrading unencrypted connections to a fully-encrypted connection. If a mail server claims to be able to use encryption, then there's no reason not to use it. The result is that all encryption certification requirements still apply even when encryption is not explicitly requested. Displaying mailbox contents mailtool -tree | -list account -tree shows a hierarchical representation of mail folders in account. -list generates a simple folder listing, one folder name per line. -tree shows folder names, while -list shows the actual mail folder path in account. mailtool -tree imap://jsmith@mail.example.com/novalidate-cert/cram Creating folders mailtool -create | -createdir folder name account -create creates a new subfolder of folder in account. The new subfolder's name is name. -createdir creates a new folder directory (a folder that contains other folders). mailtool -create INBOX.lists announcements maildir:Maildir This command creates a new folder "announcements" as a subfolders of "INBOX.lists" in the local maildir. Deleting folders mailtool -delete | -deletedir folder account -delete deletes an existing folder in account. -deletedir deletes a folder directory. mailtool -delete INBOX.lists.announcements maildir:Maildir Renaming folders mailtool -rename oldfolder folder name account -renames renames an existing oldfolder. The folder is renamed as name, as a subfolder of folder. folder may be an empty string if the folder should be moved to the top level of account's folder hierarchy. mailtool -rename INBOX.lists.announcements INBOX.lists Announcements maildir:Maildir The folder "INBOX.lists.announcements" is renamed to "INBOX.lists.Announcements". This slightly unusual way to rename folder allows folders to be relocated in the mail account's folder hierarchy. Reading folder's index mailtool -index folder account -index downloads and prints a summary of all messages in folder, in account. The summary shows the sender's and recipients' address, the message's subject, and size. mailtool -index INBOX imap://john@mail.example.com/novalidate-cert Removing a message from a folder mailtool -remove folder n account -remove removes message #n (ranging from 1 to the number of messages in the folder) in folder, in account. The message numbers may be obtained by using -index. n may be a comma-separated list of message numbers, in strictly numerically increasing order. -remove confirms the list of messages to remove and issues a "Ready:" prompt. Press ENTER to remove the messages. mailtool -remove INBOX 28,31 imap://john@mail.example.com/novalidate-cert Filtering messages mailtool -filter folder account -filter is a combination of -index and -remove. folder's index is downloaded, and the summary of each message is shown, one message at a time. Each message's summary is followed by a prompt: "Delete, Skip, or Exit". Pressing D removes the message, S leaves the message unchanged, and E leaves the remaining messages unchanged. mailtool -filter INBOX pop3://john@mail.example.com/novalidate-cert Note -filter is not meant to be used with large folders. Unless messages are removed quickly, the connection to the server may be disconnected for inactivity. Copying folders mailtool [-recurse] -tofolder tofolder -copyto toaccount -fromfolder fromfolder fromaccount This command copies an entire folder, fromfolder in fromaccount to a new folder, tofolder (which will be created, if necessary) in toaccount. Optionally, -recurse specifies that all subfolders of fromfolder should also be copied. mailtool -tofolder INBOX -copyto maildir:Maildir -fromfolder "INBOX" imap://mbox100@mail.example.com/novalidate-cert mailtool -recurse -tofolder INBOX.converted_mail -copyto maildir:Maildir -fromfolder "mail" imap://mbox100@mail.example.com/novalidate-cert This example first copies the INBOX on the IMAP server to $HOME/Maildir, then copies subfolders of "mail" on the IMAP server to the "converted_mail" subfolder in the maildir. mailtool -tofolder INBOX -copyto maildir:Maildir -fromfolder "INBOX" inbox:mail mailtool -recurse -tofolder INBOX.converted_mail -copyto maildir:Maildir -fromfolder "" mbox:mail This example first copies $HOME/Inbox (accessed as the INBOX folder in inbox:mail) to $HOME/Maildir, then copies mbox folders from $HOME/mail to the "converted_mail" subfolder in the maildir. Note Mail accounts that contain hybrid folders (folders that contain both messages and subfolders) can only be copied to account types that also support hybrid folders: either local maildirs, or to remote servers that support hybrid folders. SEE ALSO
cone(1). AUTHOR
Sam Varshavchik Cone(C) 04/04/2011 MAILTOOL(1)
All times are GMT -4. The time now is 04:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy