Help with Backup Shell Script

Hello guys.

I am a Brazilian, I use a linux machine, to access it using the program Putty.
I own a GTA Multiplayer, I have a folder on my server named accounts, there is the account of all players.
Each player has their own file, the files are saved as follows:

PlayerName.ini

I would like to check the files that have not been modified after some time in days.
I would also like to handle the value in a line and come check if it is equal to zero.

If the file were old and the value checked in a certain row is equal to the value that I stated, change the file to a folder old files.

  • Remembering, was only place I could find to ask for this help, I hope someone in a good mood help me because I need a lot of it.

  • If I have created the topic in the wrong area, I apologize.

Use stat command to get the time of last modification:

stat -c %y PlayerName.ini

You can use an awk code for this requirement, but can you post sample content of file and desired o/p?

Hello.

Thank you for your help, more I don't understand nothing of Linux.
Only a few Putty commands nothing but.
I am asking for someone to create the script that does what it said.
I know it's ugly ask that, actually I know nothing about Linux.

You can find any ini file older than 10 days in directory /home/players with a command something like this:

find /home/players -name "*.ini" -mtime +9 -print

To also check for value of XYZ=0 you would:

find /home/players -name "*.ini" -mtime +9 -print0 | xargs -0 -r grep "XYZ=0"

Edit: you will need to supply directory where .ini file exists, also does ini file name change for each player or is it always "PlayerName.ini". What parameter is supposed to be zero and what format is the .ini file in?

Do Not.
Each file is created with the name of the player, in which case it is saved as follows:

JimCarrey.ini

What I want to check is a value in there for example:

Money = 500
Level = 0

I want to set a value, and if the value of the line of the file is different, move the file to a folder of files inactive.

The .ini extension is just to save and read.