Skip to main content
deleted 124 characters in body; edited title
Source Link
Rui F Ribeiro
  • 58k
  • 28
  • 156
  • 239

Help creating Creating script to move files based on date or filename

I have an FTP process that is constantly putting files into a directory. The date created is part of the filename in a format like this:

YYYY-MM-DD-HH-MM-SS-xxxxxxxxxx.wav

I would like to move the files to another directory based on the date the file was created. I can use either the filename or the date stamp, whichever is easier. Only the month and year needs to be considered. I have created directories using the following format:

Jan_2016 Feb_2016 

I have been creating directories and moving the files manually but I would like to automate this with a bash script that will create the directory if it does not exist.

What I have been doing so far is manually creating the directories and then running this command:

mv ./2016-02*.wav Feb_2016/

I don't have any scripting experience and I'm sure this is very easy to someone who does.

Appreciate any input on this.

Help creating script to move files based on date or filename

I have an FTP process that is constantly putting files into a directory. The date created is part of the filename in a format like this:

YYYY-MM-DD-HH-MM-SS-xxxxxxxxxx.wav

I would like to move the files to another directory based on the date the file was created. I can use either the filename or the date stamp, whichever is easier. Only the month and year needs to be considered. I have created directories using the following format:

Jan_2016 Feb_2016 

I have been creating directories and moving the files manually but I would like to automate this with a bash script that will create the directory if it does not exist.

What I have been doing so far is manually creating the directories and then running this command:

mv ./2016-02*.wav Feb_2016/

I don't have any scripting experience and I'm sure this is very easy to someone who does.

Appreciate any input on this.

Creating script to move files based on date or filename

I have an FTP process that is constantly putting files into a directory. The date created is part of the filename in a format like this:

YYYY-MM-DD-HH-MM-SS-xxxxxxxxxx.wav

I would like to move the files to another directory based on the date the file was created. I can use either the filename or the date stamp, whichever is easier. Only the month and year needs to be considered. I have created directories using the following format:

Jan_2016 Feb_2016 

I have been creating directories and moving the files manually but I would like to automate this with a bash script that will create the directory if it does not exist.

What I have been doing so far is manually creating the directories and then running this command:

mv ./2016-02*.wav Feb_2016/

Added manual command
Source Link
djabe
  • 31
  • 1
  • 1
  • 5

I have an FTP process that is constantly putting files into a directory. The date created is part of the filename in a format like this:

YYYY-MM-DD-HH-MM-SS-xxxxxxxxxx.wav

I would like to move the files to another directory based on the date the file was created. I can use either the filename or the date stamp, whichever is easier. Only the month and year needs to be considered. I have created directories using the following format:

Jan_2016 Feb_2016 

I have been creating directories and moving the files manually but I would like to automate this with a bash script that will create the directory if it does not exist.

What I have been doing so far is manually creating the directories and then running this command:

mv ./2016-02*.wav Feb_2016/

I don't have any scripting experience and I'm sure this is very easy to someone who does.

Appreciate any input on this.

I have an FTP process that is constantly putting files into a directory. The date created is part of the filename in a format like this:

YYYY-MM-DD-HH-MM-SS-xxxxxxxxxx.wav

I would like to move the files to another directory based on the date the file was created. I can use either the filename or the date stamp, whichever is easier. Only the month and year needs to be considered. I have created directories using the following format:

Jan_2016 Feb_2016 

I have been creating directories and moving the files manually but I would like to automate this with a bash script that will create the directory if it does not exist.

Appreciate any input on this.

I have an FTP process that is constantly putting files into a directory. The date created is part of the filename in a format like this:

YYYY-MM-DD-HH-MM-SS-xxxxxxxxxx.wav

I would like to move the files to another directory based on the date the file was created. I can use either the filename or the date stamp, whichever is easier. Only the month and year needs to be considered. I have created directories using the following format:

Jan_2016 Feb_2016 

I have been creating directories and moving the files manually but I would like to automate this with a bash script that will create the directory if it does not exist.

What I have been doing so far is manually creating the directories and then running this command:

mv ./2016-02*.wav Feb_2016/

I don't have any scripting experience and I'm sure this is very easy to someone who does.

Appreciate any input on this.

added 8 characters in body; edited tags
Source Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 266

I have an FTP process that is constantly putting files into a directory. The date created is part of the filename in a format like this:

YYYY-MM-DD-HH-MM-SS-xxxxxxxxxx.wav

I would like to move the files to another directory based on the date the file was created. I can use either the filename or the date stamp, whichever is easier. Only the month and year needs to be considered. I have created directories using the following format:

Jan_2016 Feb_2016

Jan_2016 Feb_2016 

I have been creating directories and moving the files manually but I would like to automate this with a bash script that will create the directory if it does not exist.

Appreciate any input on this.

I have an FTP process that is constantly putting files into a directory. The date created is part of the filename in a format like this:

YYYY-MM-DD-HH-MM-SS-xxxxxxxxxx.wav

I would like to move the files to another directory based on the date the file was created. I can use either the filename or the date stamp, whichever is easier. Only the month and year needs to be considered. I have created directories using the following format:

Jan_2016 Feb_2016

I have been creating directories and moving the files manually but I would like to automate this with a bash script that will create the directory if it does not exist.

Appreciate any input on this.

I have an FTP process that is constantly putting files into a directory. The date created is part of the filename in a format like this:

YYYY-MM-DD-HH-MM-SS-xxxxxxxxxx.wav

I would like to move the files to another directory based on the date the file was created. I can use either the filename or the date stamp, whichever is easier. Only the month and year needs to be considered. I have created directories using the following format:

Jan_2016 Feb_2016 

I have been creating directories and moving the files manually but I would like to automate this with a bash script that will create the directory if it does not exist.

Appreciate any input on this.

Source Link
djabe
  • 31
  • 1
  • 1
  • 5
Loading