Jump to content

Will this bash script work?

Go to solution Solved by Mr_KoKa,

It should be ok. I would add check if directory already exists, so if you want to move your photos twice a day it won't crash on it. BTW. Why didn't you just check yourself?

now=$(date +"%b%-d")

echo $now

mkdir $now

mv *.jpg $now

Will this work alright?

Will it move to the folder named with the date?

 

 

I also want it to not throw the error can not move itself, if possible

 

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
https://linustechtips.com/topic/655711-will-this-bash-script-work/
Share on other sites

Link to post
Share on other sites

56 minutes ago, Mr_KoKa said:

It should be ok. I would add check if directory already exists, so if you want to move your photos twice a day it won't crash on it. BTW. Why didn't you just check yourself?

I did end up testing it, but it will only be moving the backup of my pictures once per day.

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×